make sieve of eratosthenes efficient