Skip to content

Instantly share code, notes, and snippets.

@mikamix
Last active January 1, 2016 15:29
Show Gist options
  • Save mikamix/8164348 to your computer and use it in GitHub Desktop.
Save mikamix/8164348 to your computer and use it in GitHub Desktop.
euler7 = primes !! 10000
primes = 2 : 3 : [x| x <- [5, 7..], is_prime x]
is_prime n = is_prime' [3, 5..]
where
is_prime' (x : xs)
| n `mod` x == 0 = False
| x ^ 2 > n = True
| otherwise = is_prime' xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment