Taxicab numbers: Difference between revisions
Content added Content deleted
m (→{{header|Haskell}}: (Rearranged pretty-printing to occupy less vertical space on the code page)) |
m (→{{header|Haskell}}: Removed a redundant import) |
||
Line 1,174: | Line 1,174: | ||
=={{header|Haskell}}== |
=={{header|Haskell}}== |
||
<lang haskell>import Data.List (sortBy, groupBy, tails, transpose |
<lang haskell>import Data.List (sortBy, groupBy, tails, transpose) |
||
import Data.Ord (comparing) |
import Data.Ord (comparing) |
||
Line 1,188: | Line 1,188: | ||
, y <- t ] |
, y <- t ] |
||
-- Taxicab numbers |
-- Taxicab numbers among first 1200 cubes |
||
xs :: [(Int, [(Int, ((Int, Int), (Int, Int)))])] |
xs :: [(Int, [(Int, ((Int, Int), (Int, Int)))])] |
||
xs = zip [1 ..] (taxis 1200) |
xs = zip [1 ..] (taxis 1200) |