Legendre symbol


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 quadratic residue mod p is 1 and at a non-quadratic residue is −1. Its value at zero is 0.
The Legendre symbol was introduced by Adrien-Marie Legendre in 1798 in the course of his attempts at proving the law of quadratic reciprocity. Generalizations of the symbol include the Jacobi symbol and Dirichlet characters of higher order. The notational convenience of the Legendre symbol inspired introduction of several other "symbols" used in algebraic number theory, such as the Hilbert symbol and the Artin symbol.

Definition

Let be an odd prime number. An integer is a quadratic residue modulo if it is congruent to a perfect square modulo and is a quadratic nonresidue modulo otherwise. The Legendre symbol is a function of and defined as
Legendre's original definition was by means of the explicit formula
By Euler's criterion, which had been discovered earlier and was known to Legendre, these two definitions are equivalent. Thus Legendre's contribution lay in introducing a convenient notation that recorded quadratic residuosity of a mod p. For the sake of comparison, Gauss used the notation aRp, aNp according to whether a is a residue or a non-residue modulo p. For typographical convenience, the Legendre symbol is sometimes written as or. The sequence for a equal to 0, 1, 2,... is periodic with period p and is sometimes called the Legendre sequence, with values occasionally replaced by or. Each row in the following table can be seen to exhibit periodicity, just as described.

Table of values

The following is a table of values of Legendre symbol with p ≤ 127, a ≤ 30, p odd prime.
123456789101112131415161718192021222324252627282930
31−101−101−101−101−101−101−101−101−101−10
51−1−1101−1−1101−1−1101−1−1101−1−1101−1−110
711−11−1−1011−11−1−1011−11−1−1011−11−1−1011
111−1111−1−1−11−101−1111−1−1−11−101−1111−1−1−1
131−111−1−1−1−111−1101−111−1−1−1−111−1101−111
1711−11−1−1−111−1−1−11−111011−11−1−1−111−1−1−11
191−1−11111−11−11−1−1−1−111−101−1−11111−11−11
231111−11−111−1−111−1−11−11−1−1−1−101111−11−1
291−1−11111−11−1−1−11−1−11−1−1−11−11111−1−1101
3111−111−11111−1−1−11−11−1111−1−1−1−11−1−11−1−1
371−111−1−11−11111−1−1−11−1−1−1−11−1−1−11111−11
4111−111−1−1111−1−1−1−1−11−11−111−11−11−1−1−1−1−1
431−1−11−11−1−1111−111111−1−1−11−1111−1−1−1−1−1
471111−11111−1−11−11−1111−1−11−1−111−111−1−1
531−1−11−111−1111−11−1111−1−1−1−1−1−111−1−111−1
591−1111−11−11−1−11−1−1111−11111−1−111111−1
611−1111−1−1−11−1−111111−1−111−11−1−11−11−1−1−1
671−1−11−11−1−111−1−1−11111−11−1111111−1−11−1
71111111−1111−11−1−111−1111−1−1−111−11−111
731111−11−111−1−11−1−1−11−111−1−1−1111−11−1−1−1
7911−111−1−11111−11−1−11−1111111−111−1−1−1−1
831−111−1−11−11111−1−1−111−1−1−11−11−1111111
8911−111−1−11111−1−1−1−1111−1111−1−11−1−1−1−1−1
971111−11−111−111−1−1−11−11−1−1−11−111−11−1−1−1
1011−1−1111−1−11−1−1−111−111−11111111−1−1−1−11
10311−11−1−1111−1−1−11111111−1−1−11−111−1111
1071−111−1−1−1−1111111−11−1−11−1−1−11−11−11−111
1091−1111−11−11−1−11−1−111−1−1−1111−1−111111−1
11311−11−1−1111−11−11111−11−1−1−11−1−111−11−11
12711−11−1−1−111−11−11−111111−111−1−111−1−1−11

Properties of the Legendre symbol

There are a number of useful properties of the Legendre symbol which, together with the law of quadratic reciprocity, can be used to compute it efficiently.
Let p and q be distinct odd primes. Using the Legendre symbol, the quadratic reciprocity law can be stated concisely:
Many proofs of quadratic reciprocity are based on Legendre's formula
In addition, several alternative expressions for the Legendre symbol were devised in order to produce various proofs of the quadratic reciprocity law.
The above properties, including the law of quadratic reciprocity, can be used to evaluate any Legendre symbol. For example:
Or using a more efficient computation:
The article Jacobi symbol has more examples of Legendre symbol manipulation.