def get_primes(): yield 2 found = [2] candidate = 3 while True: if all(candidate % prime for prime in found): yield candidate found.append(candidate) candidate += 2 ps = get_primes() for _, prime in zip(range(170), ps): print(prime, end=' ')
Sign in to make a reply
灰_手