Project Euler Problem 069
primes :: [Integer] primes = 2:f [3] [3,5..] where f (x:xs) ys = ps ++ f (xs++ps) [z | z<-qs,z`rem`x/=0] where (ps,qs) = span (< x*x) ys ans1 :: Integer ans1 = last . takeWhile (<1000000) . scanl1 (*) $ primes main :: IO () main = print ans1