code: def eratosthenes() -> Iterator[int]:
      
      d = {}  # type: Dict[int, List[int]]
      for i in itertools.count(2):
          if i in d:
              for j in d[i]:
                  d[i + j] = d.get(i + j, []) + [j]
              del d[i]
          else:
              d[i * i] = [i]
              yield i
docs: Generate the prime numbers with the sieve of Eratosthenes.
      https://oeis.org/A000040