euler/haskell/e002.hs

4 lines
152 B
Haskell
Raw Normal View History

2015-11-16 20:56:24 +01:00
-- 2 - all even primes lower 4 million
problem_2 :: Int
problem_2 = sum [x | x <- (takeWhile (<= 4000000) ((fix (\f x y -> x:f y (x+y))) 1 1)), even x]