Pocklington's algorithm

Last updated

Pocklington's algorithm is a technique for solving a congruence of the form

Contents

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 congruence. It was described by H.C. Pocklington in 1917. [1]

The algorithm

(Note: all are taken to mean , unless indicated otherwise.)

Inputs:

Outputs:

Solution method

Pocklington separates 3 different cases for p:

The first case, if , with , the solution is .

The second case, if , with and

  1. , the solution is .
  2. , 2 is a (quadratic) non-residue so . This means that so is a solution of . Hence or, if y is odd, .

The third case, if , put , so the equation to solve becomes . Now find by trial and error and so that is a quadratic non-residue. Furthermore, let

.

The following equalities now hold:

.

Supposing that p is of the form (which is true if p is of the form ), D is a quadratic residue and . Now the equations

give a solution .

Let . Then . This means that either or is divisible by p. If it is , put and proceed similarly with . Not every is divisible by p, for is not. The case with m odd is impossible, because holds and this would mean that is congruent to a quadratic non-residue, which is a contradiction. So this loop stops when for a particular l. This gives , and because is a quadratic residue, l must be even. Put . Then . So the solution of is got by solving the linear congruence .

Examples

The following are 4 examples, corresponding to the 3 different cases in which Pocklington divided forms of p. All are taken with the modulus in the example.

Example 0

This is the first case, according to the algorithm, , but then not 43, so we should not apply the algorithm at all. The reason why the algorithm is not applicable is that a=43 is a quadratic non residue for p=47.

Example 1

Solve the congruence

The modulus is 23. This is , so . The solution should be , which is indeed true: .

Example 2

Solve the congruence

The modulus is 13. This is , so . Now verifying . So the solution is . This is indeed true: .

Example 3

Solve the congruence . For this, write . First find a and such that is a quadratic nonresidue. Take for example . Now find , by computing

And similarly such that

Since , the equation which leads to solving the equation . This has solution . Indeed, .

Related Research Articles

Chinese remainder theorem Theorem for solving simultaneous congruences

In number theory, the Chinese remainder theorem states that if one knows the remainders of the Euclidean division of an integer n by several integers, then one can determine uniquely the remainder of the division of n by the product of these integers, under the condition that the divisors are pairwise coprime.

In number theory, the Legendre symbol is a multiplicative function with values 1, −1, 0 that is a quadratic character modulo an odd prime number p: its value at a (nonzero) quadratic residue mod p is 1 and at a non-quadratic residue (non-residue) is −1. Its value at zero is 0.

Modular arithmetic Computation modulo a fixed integer

In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" when reaching a certain value, called the modulus. The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his book Disquisitiones Arithmeticae, published in 1801.

Quadratic reciprocity theorem

In number theory, the law of quadratic reciprocity is a theorem about modular arithmetic that gives conditions for the solvability of quadratic equations modulo prime numbers. Due to its subtlety, it has many formulations, but the most standard statement is:

In number theory, Euler's theorem states that if n and a are coprime positive integers, then

The Jacobi symbol is a generalization of the Legendre symbol. Introduced by Jacobi in 1837, it is of theoretical interest in modular arithmetic and other branches of number theory, but its main use is in computational number theory, especially primality testing and integer factorization; these in turn are important in cryptography.

In number theory, Euler's criterion is a formula for determining whether an integer is a quadratic residue modulo a prime. Precisely,

In number theory, an integer q is called a quadratic residue modulo n if it is congruent to a perfect square modulo n; i.e., if there exists an integer x such that:

In number theory, the Ankeny–Artin–Chowla congruence is a result published in 1953 by N. C. Ankeny, Emil Artin and S. Chowla. It concerns the class number h of a real quadratic field of discriminant d > 0. If the fundamental unit of the field is

In number theory, a congruence of squares is a congruence commonly used in integer factorization algorithms.

The quadratic sieve algorithm (QS) is an integer factorization algorithm and, in practice, the second fastest method known. It is still the fastest for integers under 100 decimal digits or so, and is considerably simpler than the number field sieve. It is a general-purpose factorization algorithm, meaning that its running time depends solely on the size of the integer to be factored, and not on special structure or properties. It was invented by Carl Pomerance in 1981 as an improvement to Schroeppel's linear sieve.

In number theory, the Kronecker symbol, written as or , is a generalization of the Jacobi symbol to all integers . It was introduced by Leopold Kronecker.

Gauss's lemma in number theory gives a condition for an integer to be a quadratic residue. Although it is not useful computationally, it has theoretical significance, being involved in some proofs of quadratic reciprocity.

In number theory, the law of quadratic reciprocity, like the Pythagorean theorem, has lent itself to an unusual number of proofs. Several hundred proofs of the law of quadratic reciprocity have been found.

The Tonelli–Shanks algorithm is used in modular arithmetic to solve for r in a congruence of the form r2n, where p is a prime: that is, to find a square root of n modulo p.

Cubic reciprocity is a collection of theorems in elementary and algebraic number theory that state conditions under which the congruence x3 ≡ p (mod q) is solvable; the word "reciprocity" comes from the form of the main theorem, which states that if p and q are primary numbers in the ring of Eisenstein integers, both coprime to 3, the congruence x3p is solvable if and only if x3q is solvable.

In mathematics, in particular the area of number theory, a modular multiplicative inverse of an integer a is an integer x such that the product ax is congruent to 1 with respect to the modulus m. In the standard notation of modular arithmetic this congruence is written as

Quartic or biquadratic reciprocity is a collection of theorems in elementary and algebraic number theory that state conditions under which the congruence x4p is solvable; the word "reciprocity" comes from the form of some of these theorems, in that they relate the solvability of the congruence x4p to that of x4q.

References

  1. H.C. Pocklington, Proceedings of the Cambridge Philosophical Society, Volume 19, pages 57–58