Skip to content

Instantly share code, notes, and snippets.

@OpenGrid
Last active December 19, 2015 00:18
Show Gist options
  • Select an option

  • Save OpenGrid/5867325 to your computer and use it in GitHub Desktop.

Select an option

Save OpenGrid/5867325 to your computer and use it in GitHub Desktop.

Revisions

  1. OpenGrid revised this gist Jun 26, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions primes.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    var nthEstimate = function(N) {
    // http://en.wikipedia.org/wiki/Rosser%27s_theorem
    return ~~(N * (Math.log(N) + Math.log(Math.log(N-1))));
    }
  2. OpenGrid revised this gist Jun 26, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions primes.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    var nthEstimate = function(N) {
    return ~~(N * (Math.log(N) + Math.log(Math.log(N-1))));
    }
    return ~~(N * (Math.log(N) + Math.log(Math.log(N-1))));
    }
  3. OpenGrid created this gist Jun 26, 2013.
    3 changes: 3 additions & 0 deletions primes.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    var nthEstimate = function(N) {
    return ~~(N * (Math.log(N) + Math.log(Math.log(N-1))));
    }