FiSGO.PrimesHandler

Module implementing prime number handling functions.

Functions

contained_power

Given integers n, d, returns the integer m such that d**m divides n but d**(m+1) does not divide n.

factor

Given an integer n, it attempts to find the prime factors of n. Returns a tuple:

is_power

Given two integers n and d, returns True if there exists a positive integer m such that n = d**m, returns False otherwise.

is_prime

Given an integer n, returns True if it is prime and False if it is not.

nth_prime

Given an integer n, returns the nth prime number.

prime_list

Given an integer n, returns a list of the first n primes in file primes_path using FiSGO.PrimesHandler.primes().

prime_reconstructor

Given a list of integers 'powers', computes the product N of the first len(powers) primes raised to the integers of 'powers', returns N*leftover.

prime_scanner

Given integers n, upper_bound, returns a tuple containing:

prime_scanner_local

Given integers n, primes, returns a tuple containing:

primes

Given an integer n, returns a generator of the first n primes in file primes_path.

primes_lt

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

primes_lt_list

Given an integer n, returns a list of all primes less than n in file primes_path using FiSGO.PrimesHandler.primes_lt().