optimized prime number checking
sieve of eratosthenes