Skip to content

A library for number theory and modular arithmetic algorithms in Python e.g. Pollard Rho, Miller–Rabin primality test, Cipolla, etc.

Notifications You must be signed in to change notification settings

SeroviICAI/Modular_Arithmetic_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Modular_Arithmetic_Python

Description

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.

Algorithms:

Miller test (deterministic, not pseudoprimality) - es_primo:

· Checks wether a number is prime or not.

Sieve of Eratosthenes - lista_primos:

· Returns all prime numbers within a specified interval.

Pollard Rho - factorizar:

· Factorise any given number

Extended Euclidean algorithm - mcd

· Calculates the greates common divisor of two numbers. There is another function, "mcd_n", for more than 2 numbers.

Bézout's lemma - bezout

· Returns the Bézout coefficients given a diophantine equation.

Euler's totient function

· Counts the positive integers up to a given integer.

Chinese remainder theorem

· Gives a unique solution to simultaneous linear congruences with coprime moduli.

Cipolla algorithm

· Solves equations of this type: x^2 = n (mod p)

More information

It is possible to find more documentation in the code comments and docstrings.

About

A library for number theory and modular arithmetic algorithms in Python e.g. Pollard Rho, Miller–Rabin primality test, Cipolla, etc.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages