fork download
from itertools import islice

def integers_from(n):    # 2,3,4,...
    while True:
        yield n
        n += 1

def sieve(s):
    x = next(s)  
    yield x
    ps = sieve( integers_from(2))           # independent primes supply
    p = next(ps) 
    q = p*p       ; print((p,q))
    while True:
        x = next(s)
        while x
				
				
				
				
				
				
			
Success #stdin #stdout 0.79s 9568KB
stdin
Standard input is empty
stdout
(2, 4)
(2, 4)
(2, 4)
(2, 4)
(2, 4)
[224629, 224633, 224669, 224677, 224683, 224699, 224711, 224717, 224729, 224737]