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 = do
main =
putStrLn "First 32 Riordan terms:"
putStrLn "First 32 Riordan terms:"
mapM_ print $ take 32 riordans
>> mapM_ print (take 32 riordans)
>> mapM_

( \x ->
mapM_
( \x ->
putStrLn $
putStrLn
concat
( ("\nDigit count of " <> show x <> "th Riordan term:\n")
[ "\nDigit count of ",
<> (show . length . show) (riordans !! pred x)
show x,
)
"th Riordan term:\n",
(show . length . show)
)
(riordans !! pred x)
[1000, 10000]</syntaxhighlight>
]
)
[1000, 10000]</syntaxhighlight>
{{Out}}
{{Out}}
<pre>First 32 Riordan terms:
<pre>First 32 Riordan terms: