Quadratic Residue Symbol
   HOME

TheInfoList



OR:

In
number theory Number theory is a branch of pure mathematics devoted primarily to the study of the integers and arithmetic functions. Number theorists study prime numbers as well as the properties of mathematical objects constructed from integers (for example ...
, the Legendre symbol is a
multiplicative function In number theory, a multiplicative function is an arithmetic function f of a positive integer n with the property that f(1)=1 and f(ab) = f(a)f(b) whenever a and b are coprime. An arithmetic function is said to be completely multiplicative (o ...
with values 1, −1, 0 that is a quadratic character
modulo In computing and mathematics, the modulo operation returns the remainder or signed remainder of a division, after one number is divided by another, the latter being called the '' modulus'' of the operation. Given two positive numbers and , mo ...
of an odd
prime number A prime number (or a prime) is a natural number greater than 1 that is not a Product (mathematics), 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 ...
''p'': its value at a (nonzero)
quadratic residue In number theory, an integer ''q'' is a quadratic residue modulo operation, modulo ''n'' if it is Congruence relation, congruent to a Square number, perfect square modulo ''n''; that is, if there exists an integer ''x'' such that :x^2\equiv q \pm ...
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 Adrien-Marie Legendre (; ; 18 September 1752 – 9 January 1833) was a French people, French mathematician who made numerous contributions to mathematics. Well-known and important concepts such as the Legendre polynomials and Legendre transforma ...
in 1797 or 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 character In analytic number theory and related branches of mathematics, a complex-valued arithmetic function \chi: \mathbb\rightarrow\mathbb is a Dirichlet character of modulus m (where m is a positive integer) if for all integers a and b: # \chi(ab) = \ch ...
s 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 In mathematics, the Hilbert symbol or norm-residue symbol is a function (–, –) from ''K''× × ''K''× to the group of ''n''th roots of unity in a local field ''K'' such as the fields of real number, reals or p-adic numbers. It is related to rec ...
and the Artin symbol.


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 (mathematics), 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 ...
. An integer a is a
quadratic residue In number theory, an integer ''q'' is a quadratic residue modulo operation, modulo ''n'' if it is Congruence relation, congruent to a Square number, perfect square modulo ''n''; that is, if there exists an integer ''x'' such that :x^2\equiv q \pm ...
modulo p if it is
congruent Congruence may refer to: Mathematics * Congruence (geometry), being the same size and shape * Congruence or congruence relation, in abstract algebra, an equivalence relation on an algebraic structure that is compatible with the structure * In modu ...
to a perfect square 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 Johann Carl Friedrich Gauss (; ; ; 30 April 177723 February 1855) was a German mathematician, astronomer, Geodesy, geodesist, and physicist, who contributed to many fields in mathematics and science. He was director of the Göttingen Observat ...
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 Periodicity or periodic may refer to: Mathematics * Bott periodicity theorem, addresses Bott periodicity: a modulo-8 recurrence relation in the homotopy groups of classical groups * Periodic function, a function whose output contains values tha ...
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 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 ...
, 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 elements in \mathbb_p^* are quadratic residues. * If p \equiv 3 \text 4 then the fact that *: \frac + \frac = \frac2 = \frac = \frac2 + 1 gives us that a = x^ is a 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 In number theory, functions of positive integers which respect products are important and are called completely multiplicative functions or totally multiplicative functions. A weaker condition is also important, respecting only products of coprime ...
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 In analytic number theory and related branches of mathematics, a complex-valued arithmetic function \chi: \mathbb\rightarrow\mathbb is a Dirichlet character of modulus m (where m is a positive integer) if for all integers a and b: # \chi(ab) = \ch ...
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 In mathematics, the Fibonacci sequence is a sequence in which each element is the sum of the two elements that precede it. Numbers that are part of the Fibonacci sequence are known as Fibonacci numbers, commonly denoted . Many writers begin the s ...
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 rec ...
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 wheth ...
. 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 Fibona ...
.


Sums of Legendre symbols

Sums of the form \sum \left(\frac\right), typically taken over all integers in the range \left ,p-1\right/math> for some function f, are a special case of character sums. They are of interest in the distribution of
quadratic residues In number theory, an integer ''q'' is a quadratic residue modulo ''n'' if it is congruent to a perfect square modulo ''n''; that is, if there exists an integer ''x'' such that :x^2\equiv q \pmod. Otherwise, ''q'' is a quadratic nonresidue mod ...
modulo a prime number.


Legendre symbol and quadratic reciprocity

Let ''p'' and ''q'' be distinct odd primes. Using the Legendre symbol, the
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 ...
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 mathematical proof, proofs. Several hundred proofs of the law of quadratic reciprocity have been published. Proof syno ...
are based on Euler's criterion :\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; f ...
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 special kinds of meromorphic functions, that satisfy two periodicity conditions. They are named elliptic functions because they come from elliptic integrals. Those integrals are ...
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 opposite that ...
, 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 ...
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 ...
\left(\frac\right) 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 \cdo ...
, 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, a ...
() 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, a ...
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 In mathematics, factorization (or factorisation, see American and British English spelling differences#-ise, -ize (-isation, -ization), English spelling differences) or factoring consists of writing a number or another mathematical object as a p ...
algorithm is known, but efficient
modular exponentiation Modular exponentiation is exponentiation performed over a modulus. It is useful in computer science, especially in the field of public-key cryptography, where it is used in both Diffie–Hellman key exchange and RSA public/private keys. Modula ...
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 In mathematics and computer programming, exponentiating by squaring is a general method for fast computation of large positive integer powers of a number, or more generally of an element of a semigroup, like a polynomial or a square matrix. Some ...
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 \left(\frac\right) with ''p'' ≤ 127, ''a'' ≤ 30, ''p'' odd prime.


Notes


References

* * * * * * * {{Citation , last1=Ribenboim , first1=Paulo , title=The New Book of Prime Number Records , publisher=
Springer Springer or springers may refer to: Publishers * Springer Science+Business Media, aka Springer International Publishing, a worldwide publishing group founded in 1842 in Germany formerly known as Springer-Verlag. ** Springer Nature, a multinationa ...
, location=New York , year=1996 , isbn=0-387-94457-5


External links


Jacobi symbol calculator
Modular arithmetic Quadratic residue