FiSGO.PrimesHandler.prime_scanner

prime_scanner(n, upper_bound, primes_path='/home/docs/checkouts/readthedocs.org/user_builds/fisgo/checkouts/latest/FiSGO/PrecomputedData/BuiltinPrimes.txt')[source]
Given integers n, upper_bound, returns a tuple containing:
  • [0] A list with contained_power(n, p) for each p prime smaller than upper_bound.

  • [1] Leftover factor, containing factors of primes higher than upper_bound.

This function uses FiSGO.PrimesHandler.primes_lt() to get the primes less than upper_bound.

Parameters:
  • n (int) – Integer.

  • upper_bound (int) – Integer.

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

Return type:

tuple[list[int], int]

Returns:

Tuple containing a list of integers and an integer. The list contains the exponents of prime powers dividing n, with a prime number less than upper_bound. The integer contains the leftover factor, not comprising any prime number less than upper_bound.