Euler's criterion gives . The Legendre symbol is multiplicative, so multiplying this sign by the result of (iv) yields
A square residue modulo is a congruence class represented by for some integer . For the final all-primes solvability statement, zero is included as a square. The Legendre symbol distinguishes the zero class from the nonzero square and nonsquare classes:When the term quadratic residue is reserved for nonzero classes, the zero case must be stated separately, as in this definition.
Euler's criterion states, for an odd prime ,Apply it to . The integer is when and when . Since those signs are distinct modulo an odd prime, the modular congruence determines the actual Legendre symbol:This is the first supplementary law for quadratic reciprocity.
For an odd prime , the Legendre symbol isIt depends only on the congruence class of the integer . The values and distinguish a nonzero quadratic residue from a quadratic nonresidue; zero is a separate case.
For distinct odd prime numbers , the law of quadratic reciprocity isThus the two Legendre symbols agree unless both prime numbers are congruent to modulo , in which case they have opposite signs.
For an odd prime number , Euler's criterion states thatwhere the Legendre symbol is zero if , one if is a nonzero quadratic residue, and minus one otherwise. Including the zero case makes this formulation valid for every integer .
Apply Euler's criterion to , , and . Multiplication in modular arithmetic givesIf divides either factor, both sides are zero. Otherwise both sides belong to ; these two values are distinct modulo the odd prime number . The congruence is therefore an equality of integers, proving multiplicativity of the Legendre symbol:
For distinct odd primes , quadratic reciprocity statesHere the Legendre symbol records whether a nonzero congruence class is a quadratic residue. The first supplementary law for quadratic reciprocity and second supplementary law for quadratic reciprocity giveThus minus one is a square exactly when , and two is a square exactly when or .
To test the specified congruence class, factor . Since , multiplicativity of the Legendre symbol and quadratic reciprocity yieldThere is no sign change on swapping and because . Finally , so multiplicativity of the Legendre symbol gives , since . Therefore
For an odd prime , Euler's criterion statesFor , the Legendre symbol is for a quadratic residue and for a quadratic nonresidue; if , both sides are zero.
The product is a single power because the arithmetic progression of exponents has sum :Since , the second supplementary law for quadratic reciprocity gives . Hence Euler's criterion gives . Reduce the exponent using and :The least nonnegative remainder is therefore .
If , then for each prime factor of . The Legendre symbol depends only on the numerator's residue class, so the corresponding factors agree. Also , covering the zero cases. Multiplying givesThe convention for denominator gives the same conclusion there.
The second supplementary law for the Legendre symbol is . To multiply these signs, observe that for odd ,Both factors in the numerator are divisible by , so the right side is even. Applying this identity repeatedly to the prime factorization givesAgain the convention at agrees.
The supplementary law for the Legendre symbol is for odd prime numbers . For odd integers ,and the last term is even. Induction over the prime factors of therefore gives . ConsequentlyFor the exponent is zero.
Write , , counting repetitions. Since are coprime, every pair consists of distinct odd prime numbers. Quadratic reciprocity for the Legendre symbol givesMultiplying over all and using multiplicativity of the Jacobi symbol yields the sign exponentby the odd-product parity identity proved in (b)(i). Thus the Jacobi reciprocity law isIf either integer is , its factorization is empty and both sides equal .
Complete the square to obtain the equivalent quadratic congruenceHere : the Euclidean algorithm has successive nonzero remainders . If this modular congruence had a solution, the Jacobi symbol would be , since a square coprime to an odd modulus has Legendre symbol at every prime factor. Calculate instead, using Jacobi reciprocity and reduction of numerators,Therefore there is no solution. This obstruction does not require a separate primality test for ; the Jacobi symbol suffices.
For , quadratic reciprocity givesThe second Legendre symbol is when and when . Combining it with the sign determined by shows that a quadratic residue occurs precisely for
Point-count criterion for y squared equals x cubed plus k x Created 2026-10-05 Updated 2026-10-07
For odd and , take . If , pairing with cancels the Legendre symbols. If , the coefficient formula for trace of Frobenius modulo p givesThe binomial coefficient is nonzero because every factorial involved is shorter than . Thus the Trace of Frobenius is not zero in the second case.
Quadratic Gauss sum Created 2026-09-24 Updated 2026-10-14
For and the Legendre symbol , the quadratic Gauss sum isIt equals for and for with the standard choice of square root.
Quadratic reciprocity Created 2026-09-24 Updated 2026-10-13
Quadratic reciprocity compares two questions: is the prime number a quadratic residue modulo , and is a quadratic residue modulo ? Let be distinct odd primes. In terms of the Legendre symbol,The two Legendre symbols have opposite signs exactly when both primes are modulo ; otherwise they are equal. Their values are nonzero because the primes are distinct. Equal signs can mean two quadratic residues or two quadratic nonresidues: reciprocity compares the answers rather than declaring either answer positive.[ref]
NIST Digital Library of Mathematical Functions. T. M. Apostol, Chapter 27, §27.9, equation 27.9.3: distinct odd prime hypotheses and reciprocity law
For a direct computation, the nonzero quadratic residues modulo are respectively , , and . Squaring just suffices because and have the same square modulo an odd prime .The pair has a sign flip, whereas has two negative signs. These small quadratic residue tables make the distinction tangible.
The first supplementary law for quadratic reciprocity handles numerator , and the second supplementary law for quadratic reciprocity handles numerator :For an odd prime , is a quadratic residue exactly when , while is a quadratic residue exactly when . The remaining odd congruence classes modulo , namely , make a quadratic nonresidue. These laws fill the cases excluded from swapping distinct odd primes.[ref]
Quadratic residue Created 2026-09-24 Updated 2026-10-18
For an odd prime , a nonzero congruence class is a quadratic residue when for some integer . Here "quadratic residue" excludes zero: zero is a square of a number, but is neither a quadratic residue nor a quadratic nonresidue under this convention. Some treatments include zero among quadratic residues; the distinction matters when counting them or discussing their subgroup.[ref]
Quadratic Residue Patterns Modulo a Prime by Keith Conrad. Keith Conrad, Quadratic Residue Patterns Modulo a Prime, §1, p. 1: nonzero convention and equal counts
Modulo seven, squaring the six nonzero congruence classes givesThus the set of quadratic residues is , and the quadratic nonresidues are . In particular, has exactly the two solutions : and . Modulo eleven the quadratic residues are instead . Two is therefore a quadratic residue modulo seven and a quadratic nonresidue modulo eleven: being a quadratic residue depends on the modulus.
Why do the square roots come in pairs? If , the prime number divides , so it divides one factor: or . For nonzero these are distinct, because is an odd prime. Every nonempty nonzero fiber of a function of therefore contains exactly two inputs. Pairing the nonzero congruence classes gives exactly quadratic residues and quadratic nonresidues. Including zero gives different squares, with one rather than two square roots for zero.
The quadratic residues form a subgroup of the multiplicative group of a finite field , with index of a subgroup two. Indeed, one is a square, , and ; the inverses exist because the inputs are nonzero in the prime field. Equivalently, the squaring group homomorphism has kernel of a group homomorphism and image of a function . The apparent loss of a sign in squaring becomes a precise division of the nonzero arithmetic into two equal parts.
This structure turns a search for square roots into a yes-or-no test: Euler's criterion detects quadratic residues through modular exponentiation, and the Legendre symbol records the result as a sign. For a general integer modulus, the modular congruence still makes sense, but the two-root count and the prime field argument need not survive. For example, has four solutions ; the Chinese remainder theorem separates the sign choices modulo three and five.

