Problem 3: generate primes via sieve of Eratosthenes