Last active
December 19, 2015 00:18
-
-
Save OpenGrid/5867325 to your computer and use it in GitHub Desktop.
Estimate nth prime number value
This file contains hidden or 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
var nthEstimate = function(N) { | |
// http://en.wikipedia.org/wiki/Rosser%27s_theorem | |
return ~~(N * (Math.log(N) + Math.log(Math.log(N-1)))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment