Skip to content

Instantly share code, notes, and snippets.

@au5ton
Created August 8, 2016 17:16
Show Gist options
  • Save au5ton/b9345e2c2bc4ec59c26e9914c6a0b4de to your computer and use it in GitHub Desktop.
Save au5ton/b9345e2c2bc4ec59c26e9914c6a0b4de to your computer and use it in GitHub Desktop.
Forever counter
{
"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"
}
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