Super-d numbers: Difference between revisions
m
→{{header|Haskell}}: applied hindent (and <*>) for Rosetta 80 char width limit
m (→{{header|Haskell}}: applied hindent (and <*>) for Rosetta 80 char width limit) |
|||
Line 297:
isSuperd :: (Show a, Integral a) => a -> a -> Bool
isSuperd p n =
findSuperd :: (Show a, Integral a) => a -> [a]
findSuperd p = filter (isSuperd p) [1 ..]
main :: IO ()
main =
main = mapM_ (\n -> putStrLn ("First 10 super-" ++ show n ++ " : " ++ (show . take 10 $ findSuperd n))) [2..6]</lang>▼
mapM_
(putStrLn .
("First 10 super-" ++) .
▲
[2 .. 6]</lang>
{{out}}
<pre>
|