FiSGO.PrimesHandler.primes_lt

primes_lt(n, primes_path='/home/docs/checkouts/readthedocs.org/user_builds/fisgo/checkouts/latest/FiSGO/PrecomputedData/BuiltinPrimes.txt')[source]

Given an integer n, returns a generator of all primes less than n in file primes_path.

File primes_path is specified to PRIMES_PATH by default, containing 10^5 first primes; primes_path should refer to a file where each line contains a single prime number, in ascending order, see PRIMES_PATH for an example of the required format.

Parameters:
  • n (int) – Positive integer, strict upper bound for the primes to yield.

  • primes_path – String, path to a file with an ordered list of prime numbers.

Return type:

Generator[int, None, None]

Returns:

Generator of integers, a generator of all prime numbers less than n.