Riordan numbers: Difference between revisions
Content added Content deleted
(→{{Haskell}}: Added a Haskell version) |
|||
Line 436: | Line 436: | ||
) |
) |
||
[3 ..] |
[3 ..] |
||
-------------------------- TESTS ------------------------- |
-------------------------- TESTS ------------------------- |
||
main :: IO () |
main :: IO () |
||
main = |
main = |
||
putStrLn "First 32 Riordan terms:" |
putStrLn "First 32 Riordan terms:" |
||
mapM_ print |
>> mapM_ print (take 32 riordans) |
||
⚫ | |||
( \x -> |
|||
⚫ | |||
putStrLn $ |
|||
concat |
|||
[ "\nDigit count of ", |
|||
show x, |
|||
"th Riordan term:\n", |
|||
(show . length . show) |
|||
⚫ | |||
(riordans !! pred x) |
|||
⚫ | |||
] |
|||
⚫ | |||
⚫ | |||
{{Out}} |
{{Out}} |
||
<pre>First 32 Riordan terms: |
<pre>First 32 Riordan terms: |