From 2f6449a25a07c52de43fa406e18b00999d0dd484 Mon Sep 17 00:00:00 2001 From: ddidderr Date: Thu, 7 Dec 2023 18:37:42 +0100 Subject: [PATCH] [fix] prime sieve was missing the number 2 --- src/sieve.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sieve.rs b/src/sieve.rs index d625d3a..42038bc 100644 --- a/src/sieve.rs +++ b/src/sieve.rs @@ -7,6 +7,7 @@ pub fn get_primes(max_nr: usize) -> Vec { sieve[1] = false; let mut nr = 2; + primes.push(2); loop { check_off_multiples_of_nr(nr, &mut sieve);