Primality test/prime summing in Python based on Sieve of Eratosthenes