forgot 1 isnt prime, we can skip 1

This commit is contained in:
The Ghost of FOSS' Past 2024-10-21 22:02:50 +00:00
parent 4b96a2938e
commit 579175a08e

View file

@ -15,7 +15,7 @@ const rl = readline.createInterface({ input, output });
rl.question('Sive to: ', (siveTo) => { rl.question('Sive to: ', (siveTo) => {
siveTo = Number(siveTo) siveTo = Number(siveTo)
for (var i = 0; i < siveTo; i++) { for (var i = 1; i < siveTo; i++) {
if (isPrime(i)) { if (isPrime(i)) {
primes.push(i) primes.push(i)
} }