Category: Number theoretic algorithms

Generation of primes
In computational number theory, a variety of algorithms make it possible to generate prime numbers efficiently. These are used in various applications, for example hashing, public-key cryptography, an
Extended Euclidean algorithm
In arithmetic and computer programming, the extended Euclidean algorithm is an extension to the Euclidean algorithm, and computes, in addition to the greatest common divisor (gcd) of integers a and b,
Euclidean algorithm
In mathematics, the Euclidean algorithm, or Euclid's algorithm, is an efficient method for computing the greatest common divisor (GCD) of two integers (numbers), the largest number that divides them b
Lehmer's GCD algorithm
Lehmer's GCD algorithm, named after Derrick Henry Lehmer, is a fast GCD algorithm, an improvement on the simpler but slower Euclidean algorithm. It is mainly used for big integers that have a represen
Cornacchia's algorithm
In computational number theory, Cornacchia's algorithm is an algorithm for solving the Diophantine equation , where and d and m are coprime. The algorithm was described in 1908 by Giuseppe Cornacchia.
Integer relation algorithm
An integer relation between a set of real numbers x1, x2, ..., xn is a set of integers a1, a2, ..., an, not all 0, such that An integer relation algorithm is an algorithm for finding integer relations
Cipolla's algorithm
In computational number theory, Cipolla's algorithm is a technique for solving a congruence of the form where , so n is the square of x, and where is an odd prime. Here denotes the finite field with e
Berlekamp–Rabin algorithm
In number theory, Berlekamp's root finding algorithm, also called the Berlekamp–Rabin algorithm, is the probabilistic method of finding roots of polynomials over a field . The method was discovered by
Computational complexity of mathematical operations
The following tables list the computational complexity of various algorithms for common mathematical operations. Here, complexity refers to the time complexity of performing computations on a multitap
Modular exponentiation
Modular exponentiation is exponentiation performed over a modulus. It is useful in computer science, especially in the field of public-key cryptography, where it is used in both Diffie-Hellman Key Exc
Meissel–Lehmer algorithm
The Meissel–Lehmer algorithm (after Ernst Meissel and Derrick Henry Lehmer) is an algorithm that computes exact values of the prime-counting function.
Ancient Egyptian multiplication
In mathematics, ancient Egyptian multiplication (also known as Egyptian multiplication, Ethiopian multiplication, Russian multiplication, or peasant multiplication), one of two multiplication methods
Bhaskara's lemma
Bhaskara's Lemma is an identity used as a lemma during the chakravala method. It states that: for integers and non-zero integer .
Chakravala method
The chakravala method (Sanskrit: चक्रवाल विधि) is a cyclic algorithm to solve indeterminate quadratic equations, including Pell's equation. It is commonly attributed to Bhāskara II, (c. 1114 – 1185 CE
Tonelli–Shanks algorithm
The Tonelli–Shanks algorithm (referred to by Shanks as the RESSOL algorithm) is used in modular arithmetic to solve for r in a congruence of the form r2 ≡ n (mod p), where p is a prime: that is, to fi
Pohlig–Hellman algorithm
In group theory, the Pohlig–Hellman algorithm, sometimes credited as the Silver–Pohlig–Hellman algorithm, is a special-purpose algorithm for computing discrete logarithms in a finite abelian group who
Pollard's kangaroo algorithm
In computational number theory and computational algebra, Pollard's kangaroo algorithm (also Pollard's lambda algorithm, see below) is an algorithm for solving the discrete logarithm problem. The algo
Integer square root
In number theory, the integer square root (isqrt) of a non-negative integer n is the non-negative integer m which is the greatest integer less than or equal to the square root of n, For example,
Binary GCD algorithm
The binary GCD algorithm, also known as Stein's algorithm or the binary Euclidean algorithm, is an algorithm that computes the greatest common divisor of two nonnegative integers. Stein's algorithm us
Pollard's rho algorithm for logarithms
Pollard's rho algorithm for logarithms is an algorithm introduced by John Pollard in 1978 to solve the discrete logarithm problem, analogous to Pollard's rho algorithm to solve the integer factorizati
Rational reconstruction (mathematics)
In mathematics, rational reconstruction is a method that allows one to recover a rational number from its value modulo a sufficiently large integer.
Baby-step giant-step
In group theory, a branch of mathematics, the baby-step giant-step is a meet-in-the-middle algorithm for computing the discrete logarithm or order of an element in a finite abelian group by Daniel Sha
Pocklington's algorithm
Pocklington's algorithm is a technique for solving a congruence of the form where x and a are integers and a is a quadratic residue. The algorithm is one of the first efficient methods to solve such a