On Thu, Jul 12, 2018, 7:56 AM Serhiy Storchaka email@example.com wrote:
Tests if n is a prime number.
How would you test this? The Miller-Rabin Primality test? For large numbers, iterating through candidate prime divisors is pricey.
Returns an iterator of prime numbers: 2, 3, 5, 7, 11, 13,...
How would you implements this? Sieve of Eratosthenes is really fun to show students as a Python generator function. But the cached primes DO grow unboundedly as you utilize the generator. Wheel factorization as first pass? Do you cached the first N primes so the each instance of iterator can provide initial elements much faster? What is N?