This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
project-euler/e0002/euler0002.hs
2017-12-15 18:17:11 +01:00

6 lines
149 B
Haskell

main :: IO()
main = do
print (sum ret)
where
fibs = 1 : 2 : zipWith (+) fibs (tail fibs)
ret = filter even (takeWhile (<= 4000000) fibs)