Quadratic Residue Symbol
   HOME

TheInfoList



OR:

In
number theory Number theory (or arithmetic or higher arithmetic in older usage) is a branch of pure mathematics devoted primarily to the study of the integers and arithmetic function, integer-valued functions. German mathematician Carl Friedrich Gauss (1777â ...
, the Legendre symbol is a multiplicative function with values 1, −1, 0 that is a quadratic character modulo an odd
prime number A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
''p'': its value at a (nonzero)
quadratic residue 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: :x^2\equiv q \pmod. Otherwise, ''q'' is called a quadratic no ...
mod ''p'' is 1 and at a non-quadratic residue (''non-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 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 st ...
. Generalizations of the symbol include the
Jacobi symbol Jacobi symbol for various ''k'' (along top) and ''n'' (along left side). Only are shown, since due to rule (2) below any other ''k'' can be reduced modulo ''n''. Quadratic residues are highlighted in yellow — note that no entry with a ...
and Dirichlet characters of higher order. The notational convenience of the Legendre symbol inspired introduction of several other "symbols" used in
algebraic number theory Algebraic number theory is a branch of number theory that uses the techniques of abstract algebra to study the integers, rational numbers, and their generalizations. Number-theoretic questions are expressed in terms of properties of algebraic ob ...
, such as the Hilbert symbol and the
Artin symbol The Artin reciprocity law, which was established by Emil Artin in a series of papers (1924; 1927; 1930), is a general theorem in number theory that forms a central part of global class field theory. The term "reciprocity law" refers to a long line ...
.


Definition

Let p be an odd
prime number A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
. An integer a is a
quadratic residue 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: :x^2\equiv q \pmod. Otherwise, ''q'' is called a quadratic no ...
modulo p if it is congruent to a
perfect square ''Perfect Square'' is a 2004 concert film of the alternative rock Musical ensemble, band R.E.M. (band), R.E.M., filmed on July 19, 2003, at the bowling green, Bowling Green in Wiesbaden, Germany. It was released by Warner Reprise Video on March 9, ...
modulo p and is a quadratic nonresidue modulo p otherwise. The Legendre symbol is a function of a and p defined as :\left(\frac\right) = \begin 1 & \text a \text p \text a \not\equiv 0\pmod p, \\ -1 & \text a \text p, \\ 0 & \text a \equiv 0 \pmod p. \end Legendre's original definition was by means of the explicit formula : \left(\frac\right) \equiv a^ \pmod p \quad \text \quad\left(\frac\right) \in \. By
Euler's criterion In number theory, Euler's criterion is a formula for determining whether an integer is a quadratic residue modulo a prime. Precisely, Let ''p'' be an odd prime and ''a'' be an integer coprime to ''p''. Then : a^ \equiv \begin \;\;\,1\pmod& \text ...
, 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 ''a''R''p'', ''a''N''p'' 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 \left(\tfrac\right),\left(\tfrac\right),\left(\tfrac\right),\ldots is periodic with period ''p'' and is sometimes called the Legendre sequence. Each row in the following table exhibits periodicity, just as described.


Table of values

The following is a table of values of Legendre symbol \left(\frac\right) with ''p'' â‰¤ 127, ''a'' â‰¤ 30, ''p'' odd prime.


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 g \in \mathbb_p^*, if x = g^r, then x is a quadratic residue if and only if r is even. This shows that half of the nonzero elements in \mathbb_p^* are quadratic residues. * If p \equiv 3 \text 4 then the fact that *: \frac + \frac = \frac gives us that a = x^ is the square root of the quadratic residue x. * The Legendre symbol is periodic in its first (or top) argument: if ''a'' ≡ ''b'' (mod ''p''), then *: \left(\frac\right) = \left(\frac\right). * The Legendre symbol is a completely multiplicative function of its top argument: *:\left(\frac\right) = \left(\frac\right)\left(\frac\right). * 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: *:\left(\frac\right) = \begin 1 & \mboxp\nmid x\\ 0 & \mboxp\mid x. \end * When viewed as a function of ''a'', the Legendre symbol \left(\frac\right) is the unique quadratic (or order 2) Dirichlet character modulo ''p''. * The first supplement to the law of quadratic reciprocity: *:\left(\frac\right) = (-1)^ = \begin 1 & \mboxp \equiv 1\pmod \\ -1 & \mboxp \equiv 3\pmod. \end * The second supplement to the law of quadratic reciprocity: *: \left(\frac\right) = (-1)^\tfrac = \begin 1 & \mboxp \equiv 1\mbox7 \pmod \\ -1 & \mboxp \equiv 3\mbox5 \pmod. \end * Special formulas for the Legendre symbol \left(\frac\right) for small values of ''a'': ** For an odd prime ''p'' â‰  3, **: \left(\frac\right) = (-1)^ = \begin 1 & \mboxp \equiv 1\mbox11 \pmod \\ -1 & \mboxp \equiv 5\mbox7 \pmod. \end ** For an odd prime ''p'' â‰  5, **: \left(\frac\right) =(-1)^ = \begin 1 & \mboxp \equiv 1\mbox4 \pmod5 \\ -1 & \mboxp \equiv 2\mbox3 \pmod5. \end * The Fibonacci numbers 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, … are defined by the recurrence If ''p'' is a prime number then *: F_ \equiv 0 \pmod p, \qquad F_ \equiv \left(\frac\right) \pmod p. :For example, ::\begin \left(\tfrac\right) &= -1, & F_3 &= 2, & F_2 &= 1, \\ \left(\tfrac\right) &= -1, & F_4 &= 3, & F_3 &= 2, \\ \left(\tfrac\right) &= 0, & F_5 &= 5, & & \\ \left(\tfrac\right) &= -1, & F_8 &= 21, & F_7 &= 13, \\ \left(\tfrac\right) &= 1, & F_ &= 55, & F_ &= 89. \end *This result comes from the theory of
Lucas sequence In mathematics, the Lucas sequences U_n(P,Q) and V_n(P, Q) are certain constant-recursive integer sequences that satisfy the recurrence relation : x_n = P \cdot x_ - Q \cdot x_ where P and Q are fixed integers. Any sequence satisfying this recu ...
s, which are used in
primality testing A primality test is an algorithm for determining whether an input number is prime. Among other fields of mathematics, it is used for cryptography. Unlike integer factorization, primality tests do not generally give prime factors, only stating wh ...
. See
Wall–Sun–Sun prime In number theory, a Wall–Sun–Sun prime or Fibonacci–Wieferich prime is a certain kind of prime number which is conjectured to exist, although none are known. Definition Let p be a prime number. When each term in the sequence of Fibonac ...
.


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: : \left(\frac\right)\left(\frac\right) = (-1)^. Many
proofs of quadratic reciprocity In number theory, the law of quadratic reciprocity, like the Pythagorean theorem, has lent itself to an unusually large number of proofs. Several hundred proofs of the law of quadratic reciprocity have been published. Proof synopsis Of the element ...
are based on
Euler's criterion In number theory, Euler's criterion is a formula for determining whether an integer is a quadratic residue modulo a prime. Precisely, Let ''p'' be an odd prime and ''a'' be an integer coprime to ''p''. Then : a^ \equiv \begin \;\;\,1\pmod& \text ...
:\left(\frac\right) \equiv a^ \pmod p. In addition, several alternative expressions for the Legendre symbol were devised in order to produce various proofs of the quadratic reciprocity law. * Gauss introduced the
quadratic Gauss sum In number theory, quadratic Gauss sums are certain finite sums of roots of unity. A quadratic Gauss sum can be interpreted as a linear combination of the values of the complex exponential function with coefficients given by a quadratic character; fo ...
and used the formula ::\sum_^\zeta^=\left(\frac\right)\sum_^\zeta^,\qquad \zeta = e^ :in his fourth and sixth proofs of quadratic reciprocity. * Kronecker's proof first establishes that ::\left(\frac\right) =\sgn\left(\prod_^\prod_^\left(\frac-\frac\right)\right). : Reversing the roles of ''p'' and ''q'', he obtains the relation between () and (). * One of Eisenstein's proofsLemmermeyer, pp. 236 ff. begins by showing that ::\left(\frac\right) =\prod_^ \frac. : Using certain
elliptic function In the mathematical field of complex analysis, elliptic functions are a special kind of meromorphic functions, that satisfy two periodicity conditions. They are named elliptic functions because they come from elliptic integrals. Originally those in ...
s instead of the
sine function In mathematics, sine and cosine are trigonometric functions of an angle. The sine and cosine of an acute angle are defined in the context of a right triangle: for the specified angle, its sine is the ratio of the length of the side that is opp ...
, Eisenstein was able to prove
cubic Cubic may refer to: Science and mathematics * Cube (algebra), "cubic" measurement * Cube, a three-dimensional solid object bounded by six square faces, facets or sides, with three meeting at each vertex ** Cubic crystal system, a crystal system w ...
and
quartic reciprocity Quartic or biquadratic reciprocity is a collection of theorems in elementary and algebraic number theory that state conditions under which the congruence ''x''4 ≡ ''p'' (mod ''q'') is solvable; the word "reciprocity" comes from the form o ...
as well.


Related functions

* The
Jacobi symbol Jacobi symbol for various ''k'' (along top) and ''n'' (along left side). Only are shown, since due to rule (2) below any other ''k'' can be reduced modulo ''n''. Quadratic residues are highlighted in yellow — note that no entry with a ...
() 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 number theory, the Kronecker symbol, written as \left(\frac an\right) or (a, n), is a generalization of the Jacobi symbol to all integers n. It was introduced by . Definition Let n be a non-zero integer, with prime factorization :n=u \cdot ...
, in which the bottom argument may be any integer. * The
power residue symbol In algebraic number theory the ''n''-th power residue symbol (for an integer ''n'' > 2) is a generalization of the (quadratic) Legendre symbol to ''n''-th powers. These symbols are used in the statement and proof of cubic, quartic, Eisenstein, ...
() generalizes the Legendre symbol to higher power ''n''. The Legendre symbol represents the
power residue symbol In algebraic number theory the ''n''-th power residue symbol (for an integer ''n'' > 2) is a generalization of the (quadratic) Legendre symbol to ''n''-th powers. These symbols are used in the statement and proof of cubic, quartic, Eisenstein, ...
for ''n'' = 2.


Computational example

The above properties, including the law of quadratic reciprocity, can be used to evaluate any Legendre symbol. For example: :\begin \left ( \frac\right )&=\left ( \frac\right ) \left ( \frac\right ) \left ( \frac\right ) \\ &= \left ( \frac\right ) \left ( \frac\right ) \left ( \frac\right ) \\ &= \left ( \frac\right ) \left ( \frac\right ) \left ( \frac\right ) \left ( \frac\right ) \\ &= (-1)\left (\frac\right) \left(\frac\right) (-1) \left(\frac\right) (-1)\left (\frac\right ) \\ &= -\left ( \frac\right ) \left ( \frac\right ) \left ( \frac\right ) \left ( \frac\right )\\ &= -\left ( \frac\right ) \left ( \frac\right ) \left ( \frac\right ) \left ( \frac\right )\\ &= -(1) (1) (1) (1) \\ &= -1. \end Or using a more efficient computation: :\left ( \frac\right )=\left ( \frac\right )=\left ( \frac\right )=\left ( \frac\right )=(-1)^\tfrac=-1. The article
Jacobi symbol Jacobi symbol for various ''k'' (along top) and ''n'' (along left side). Only are shown, since due to rule (2) below any other ''k'' can be reduced modulo ''n''. Quadratic residues are highlighted in yellow — note that no entry with a ...
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. :\begin \left(\frac\right) &\equiv 98^ &\pmod \\ &\equiv 98^ &\pmod \\ &\equiv 98 \cdot (98^2)^ &\pmod \\ &\equiv 98 \cdot 5^ &\pmod \\ &\equiv 98 \cdot 25^ &\pmod \\ &\equiv 133 \cdot 25^ &\pmod \\ &\equiv 133 \cdot 294^ &\pmod \\ &\equiv 133 \cdot 45^ &\pmod \\ &\equiv 133 \cdot 39^5 &\pmod \\ &\equiv 222 \cdot 39^4 &\pmod \\ &\equiv 222 \cdot 197^2 &\pmod \\ &\equiv 222 \cdot 82 &\pmod \\ &\equiv -1 &\pmod \end using
repeated squaring A rerun or repeat is a rebroadcast of an episode of a radio or television Broadcast programming, program. There are two types of reruns – those that occur during a Hiatus (television), hiatus, and those that occur when a program is Broadcast sy ...
modulo 331, reducing every value using the modulus after every operation to avoid computation with large integers.


Notes


References

* * * * * * *{{citation , last1 = Ribenboim , first1 = Paulo , title = The New Book of Prime Number Records , publisher = Springer , location = New York , year = 1996 , isbn = 0-387-94457-5


External links


Jacobi symbol calculator
Modular arithmetic Quadratic residue