Created
October 29, 2011 20:33
-
-
Save tedpennings/1325051 to your computer and use it in GitHub Desktop.
Finding the first 10001 prime numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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