Pell numbers: Difference between revisions
Content added Content deleted
(→{{header Haskell}}: Added a Haskell draft) |
|||
Line 430: | Line 430: | ||
, ("a002315", a002315) |
, ("a002315", a002315) |
||
] |
] |
||
putStrLn "\nRational approximations to sqrt 2:" |
putStrLn "\nRational approximations to sqrt 2:" |
||
mapM_ putStrLn $ |
mapM_ putStrLn $ |
||
tail $ |
(take 10 . tail) $ |
||
zipWith |
|||
(\n d -> show n <> ('/':show d) <> " -> " |
|||
⚫ | |||
⚫ | |||
show n <> |
|||
⚫ | |||
⚫ | |||
a001333 |
|||
a000129 |
|||
putStrLn "\nPythagorean triples:" |
putStrLn "\nPythagorean triples:" |
||
print $ take 5 pythagoreanTriples</syntaxhighlight> |
print $ take 5 pythagoreanTriples</syntaxhighlight> |