optimization of sieve of eratosthenes