euler/haskell/e010.hs

5 lines
194 B
Haskell
Raw Normal View History

2015-11-16 20:56:24 +01:00
-- 10 - sum prime smaller 2 million
eres :: Integral a => [a] -> [a]
eres (x:xs) = if x*x < last xs then x:eres (filter (\y -> rem y x /= 0) xs) else (x:xs)
problem_10 = sum $ eres [2..2000000]