Legendre symbol

Last updated
Legendre symbol (a/p)
for various a (along top) and p (along left side).
a
p
012345678910
301−1
501−1−11
7011−11−1−1
1101−1111−1−1−11−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.

Contents

In number theory, the Legendre symbol is a function of and defined as

where is an odd prime number and is a positive integer that may or may not be a quadratic residue mod p. The Legendre symbol is a multiplicative function

The Legendre symbol was introduced by Adrien-Marie Legendre in 1797 or 1798 [1] 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

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 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 (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.

For example,

Sums of Legendre symbols

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:

Many proofs of quadratic reciprocity are based on Euler's criterion

In addition, several alternative expressions for the Legendre symbol were devised in order to produce various proofs of the quadratic reciprocity law.

in his fourth [4] and sixth [5] proofs of quadratic reciprocity.
Reversing the roles of p and q, he obtains the relation between (p/q) and (q/p).
Using certain elliptic functions instead of the sine function, Eisenstein was able to prove cubic and quartic reciprocity as well.

Computational example

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.

a
p
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

Notes

  1. Legendre, A. M. (1798). Essai sur la théorie des nombres. Paris. p.  186 (published on year VI of the French Republican calendar, thus in 1797 or 1798).
  2. Hardy & Wright, Thm. 83.
  3. Ribenboim, p. 64; Lemmermeyer, ex. 2.25–2.28, pp. 73–74.
  4. Gauss, "Summierung gewisser Reihen von besonderer Art" (1811), reprinted in Untersuchungen ... pp. 463–495
  5. Gauss, "Neue Beweise und Erweiterungen des Fundamentalsatzes in der Lehre von den quadratischen Resten" (1818) reprinted in Untersuchungen ... pp. 501–505
  6. Lemmermeyer, ex. p. 31, 1.34
  7. Lemmermeyer, pp. 236 ff.

References