Skip to content

Instantly share code, notes, and snippets.

@goz
Created June 1, 2010 21:37
Show Gist options
  • Select an option

  • Save goz/421538 to your computer and use it in GitHub Desktop.

Select an option

Save goz/421538 to your computer and use it in GitHub Desktop.
isPrime n = all ((/= 0) . (mod n)) (takeWhile (\ x -> x*x <= n) primes)
primes = 2 : filter isPrime [3..]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment