src/cool_primes/sieves.py
def sieve():
    """
    Yields prime integers using Sieve of Eratosthenes.

    Generates primes lazily and recursively rather than the traditional version.
    """
    innersieve = sieve()
    prevsq = 1
    table = {}
    i = 2
    while True:
        if i in table:
            prime = table[i]
            del table[i]
            nxt = i + prime
            while nxt in table:
                nxt += prime
            table[nxt] = prime
        else:
            yield i
            if i > prevsq:
                j = next(innersieve)
                prevsq = j ** 2
                table[prevsq] = j
        i += 1

    Yields prime integers using Sieve of Eratosthenes.

    Generates primes lazily and recursively rather than the traditional version.
    
Yields prime integers using Sieve of Eratosthenes.
Generates primes lazily and recursively rather than the traditional version.
Yields prime integers using Sieve of Eratosthenes . Generates primes lazily and recursively rather than the traditional version .
def sieve():
    innersieve = sieve()
    prevsq = 1
    table = {}
    i = 2
    while True:
        if i in table:
            prime = table[i]
            del table[i]
            nxt = i + prime
            while nxt in table:
                nxt += prime
            table[nxt] = prime
        else:
            yield i
            if i > prevsq:
                j = next(innersieve)
                prevsq = j ** 2
                table[prevsq] = j
        i += 1
def sieve ( ) : innersieve = sieve ( ) prevsq = 1 table = { } i = 2 while True : if i in table : prime = table [ i ] del table [ i ] nxt = i + prime while nxt in table : nxt += prime table [ nxt ] = prime else : yield i if i > prevsq : j = next ( innersieve ) prevsq = j ** 2 table [ prevsq ] = j i += 1
Yields prime integers using Sieve of Eratosthenes.
Yields prime integers using Sieve of Eratosthenes .
"""
    Yields prime integers using Sieve of Eratosthenes.

    Generates primes lazily and recursively rather than the traditional version.
    """