Created
August 8, 2016 17:16
-
-
Save au5ton/b9345e2c2bc4ec59c26e9914c6a0b4de to your computer and use it in GitHub Desktop.
Forever counter
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
{ | |
"name": "forever-counter", | |
"version": "1.0.0", | |
"description": "", | |
"main": "prime.js", | |
"dependencies": { | |
"big-integer": "^1.6.15" | |
}, | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC" | |
} |
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 bigInt = require('big-integer'); | |
//To infinity and beyond | |
for(let i = bigInt(0);; i = i.next()) { | |
if(i.isPrime()) { | |
console.log(i.toString()+' ✅ ; '+i.toString().length+' places'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment