Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Data.List
- s = 120000
- numberPool :: [Int]
- numberPool = [1,3..s]
- sieveHelper n x = x `mod` n == 0 && not (n == x)
- sieve (x:xs)
- | x < truncate ((sqrt . fromIntegral) s) = x : sieve (filter (not . sieveHelper x) (xs))
- | otherwise = x:xs
- main = do
- putStrLn (show ( last (take 10001 (sieve numberPool))))
Add Comment
Please, Sign In to add comment