Skip to content

Instantly share code, notes, and snippets.

@gre
Last active December 18, 2017 17:50
Show Gist options
  • Save gre/4505510 to your computer and use it in GitHub Desktop.
Save gre/4505510 to your computer and use it in GitHub Desktop.
var n = 1000;
var from = 10000000000000000;
var to = from + n;
var i = from;
var missing = [];
while (i < to) {
var incr = 1;
while (i === i+incr) {
missing.push(i+" + "+incr);
incr ++;
}
i += incr;
}
console.log(missing);
console.log(missing.length+" values are missing.");
// logs: 250 values are missing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment