implements sieve with Python generator