From 579175a08e4c5b1c1913b58d65da805347858633 Mon Sep 17 00:00:00 2001 From: sneedgroup-holder Date: Mon, 21 Oct 2024 22:02:50 +0000 Subject: [PATCH] forgot 1 isnt prime, we can skip 1 --- sive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sive.js b/sive.js index 7019378..549d9c3 100644 --- a/sive.js +++ b/sive.js @@ -15,7 +15,7 @@ const rl = readline.createInterface({ input, output }); rl.question('Sive to: ', (siveTo) => { siveTo = Number(siveTo) - for (var i = 0; i < siveTo; i++) { + for (var i = 1; i < siveTo; i++) { if (isPrime(i)) { primes.push(i) }