euler/haskell/e002.hs

4 lines
152 B
Haskell

-- 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]