Legendre symbol (a/p) for various a (along top) and p (along left side).
a
p
0
1
2
3
4
5
6
7
8
9
10
3
0
1
−1
5
0
1
−1
−1
1
7
0
1
1
−1
1
−1
−1
11
−0
−1
−1
1
−1
1
−1
−1
−1
−1
−1
Only 0 ≤ a < p are shown, since due to the first property below any other a can be reduced modulo p. Quadratic residues are highlighted in yellow, and correspond precisely to the values 0 and 1.
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.[2] Thus Legendre's contribution lay in introducing a convenient notation that recorded quadratic residuosity of amodp. 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 (a|p) or (a/p). For fixed p, the sequence is periodic with period p and is sometimes called the Legendre sequence. Each row in the following table exhibits periodicity, just as described.
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.
Given a generator , if , then is a quadratic residue if and only if is even. This shows that half of the elements in are quadratic residues.
If then the fact that
gives us that is a square root of the quadratic residue .
The Legendre symbol is periodic in its first (or top) argument: if a ≡ b (mod p), then
In particular, the product of two numbers that are both quadratic residues or quadratic non-residues modulo p is a residue, whereas the product of a residue with a non-residue is a non-residue. A special case is the Legendre symbol of a square:
When viewed as a function of a, the Legendre symbol is the unique quadratic (or order 2) Dirichlet character modulo p.
The first supplement to the law of quadratic reciprocity:
The second supplement to the law of quadratic reciprocity:
Special formulas for the Legendre symbol for small values of a:
For an odd prime p≠3,
For an odd prime p≠5,
The Fibonacci numbers 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ... are defined by the recurrence F1 = F2 = 1,Fn+1 = Fn + Fn−1. If p is a prime number then
Sums of the form , typically taken over all integers in the range for some function , are a special case of character sums. They are of interest in the distribution of quadratic residues modulo a prime number.
Legendre symbol and quadratic reciprocity
Let p and q be distinct odd primes. Using the Legendre symbol, the quadratic reciprocity law can be stated concisely:
The Jacobi symbol is a generalization of the Legendre symbol that allows for a composite second (bottom) argument n, although n must still be odd and positive. This generalization provides an efficient way to compute all Legendre symbols without performing factorization along the way.
A further extension is the Kronecker symbol, in which the bottom argument may be any integer.
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.
Since no efficient factorization algorithm is known, but efficient modular exponentiation algorithms are, in general it is more efficient to use Legendre's original definition, e.g.
using repeated squaring modulo 331, reducing every value using the modulus after every operation to avoid computation with large integers.
Table of values
The following is a table of values of Legendre symbol with p≤127, a≤30, p odd prime.
↑ Ribenboim, p. 64; Lemmermeyer, ex. 2.25–2.28, pp. 73–74.
↑ Gauss, "Summierung gewisser Reihen von besonderer Art" (1811), reprinted in Untersuchungen ... pp. 463–495
↑ Gauss, "Neue Beweise und Erweiterungen des Fundamentalsatzes in der Lehre von den quadratischen Resten" (1818) reprinted in Untersuchungen ... pp. 501–505
Gauss, Carl Friedrich (1965), Untersuchungen über höhere Arithmetik (Disquisitiones Arithmeticae & other papers on number theory), translated by Maser, H. (Seconded.), New York: Chelsea, ISBN0-8284-0191-8
This page is based on this Wikipedia article Text is available under the CC BY-SA 4.0 license; additional terms may apply. Images, videos and audio are available under their respective licenses.