Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -0,0 +1,20 @@
let product = 2n;
function smallestPrimeFactor(number) {
if (number % 3n === 0n) { return 3n; }
if (number % 5n === 0n) { return 5n; }
for (let divisor = 7n; divisor * divisor <= number; divisor += 2n) {
if (number % divisor === 0n) { return divisor; }
}
return number;
}
function nextEuclidMullin() {
const smallestPrime = smallestPrimeFactor(product + 1n);
product *= smallestPrime;
return smallestPrime;
}
console.log("The first 9 terms of the Euclid-Mullin sequence:");
process.stdout.write(2 + " ");
for (let i = 1; i < 9; ++i) {
process.stdout.write(nextEuclidMullin() + " ");
}
console.log("\n");