A library for number theory and modular arithmetic algorithms in Python e.g. Pollard Rho, Miller–Rabin primality test, Cipolla, etc. A couple of implementations where inspired by Wikipedia's pseudocode.
· Checks wether a number is prime or not.
· Returns all prime numbers within a specified interval.
· Factorise any given number
· Calculates the greates common divisor of two numbers. There is another function, "mcd_n", for more than 2 numbers.
· Returns the Bézout coefficients given a diophantine equation.
· Counts the positive integers up to a given integer.
· Gives a unique solution to simultaneous linear congruences with coprime moduli.
· Solves equations of this type: x^2 = n (mod p)
It is possible to find more documentation in the code comments and docstrings.