Skip to content

Instantly share code, notes, and snippets.

@tedpennings
Created October 29, 2011 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tedpennings/1325051 to your computer and use it in GitHub Desktop.
Save tedpennings/1325051 to your computer and use it in GitHub Desktop.
Finding the first 10001 prime numbers
(def certainty 5)
(defn prime? [n]
(if (= n 1)
true
(.isProbablePrime (BigInteger/valueOf n) certainty)))
(take 10001
(filter prime?
(take-nth 2
(range 1 Integer/MAX_VALUE))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment