prime_list

prime_list(n, base_primes=[], piter=<generator object prime_iter at 0x7f75e93d9120>): 

LLM Docstring

Return the first n primes using a shared incremental cache.

The default base_primes list and piter generator are intentionally persistent across calls. The cache is extended until the iterator yields more than n entries, then the first n values are returned.

  • n: int

    number of primes requested

  • base_primes: list[int]

    mutable cache populated in place

  • piter: collections.abc.Iterator[list[int]]

    cumulative prime-list iterator used to extend the cache

  • :returns: list[int]

    the first n cached primes


Feedback

Examples

Templates

Documentation