Skip to content

Instantly share code, notes, and snippets.

@OpenGrid
Last active December 19, 2015 00:18
Show Gist options
  • Save OpenGrid/5867325 to your computer and use it in GitHub Desktop.
Save OpenGrid/5867325 to your computer and use it in GitHub Desktop.
Estimate nth prime number value
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