The functions atkinsSieve and eratosthenesSieve have some bugs:
-
In atkinsSieve:
- The loop
for(i = 7; i < limit; i++) does not include the limit itself, so primes equal to the limit are missed.
-
In eratosthenesSieve:
- The sieve initialization and result extraction are incorrect, leading to wrong prime numbers.
- Looping logic skips numbers incorrectly.
Suggested fix: Adjust loop limits and simplify sieve logic.