Sieve of Eratosthenes with wheel factorization