sieve (x:xs) = x : sieve (filter ((/= 0) . (`mod` x)) xs) p7 :: Int p7 = sieve [2..] !! 10000 main = putStrLn $ "Solution: " ++ show p7