forgot 1 isnt prime, we can skip 1
This commit is contained in:
parent
4b96a2938e
commit
579175a08e
1 changed files with 1 additions and 1 deletions
2
sive.js
2
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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue