Choose a nonzero quadratic nonresidue . There is one because the squaring map on is two-to-one, so exactly half its elements are squares. The moduli are pairwise coprime, so the Chinese remainder theorem gives a positive integer satisfying
When , the last condition is vacuous. In particular is odd and coprime to . Since , Jacobi reciprocity gives
As is odd, multiplicativity of the Jacobi symbol now yields
Euler's criterion states that
For this says that the power is for a quadratic residue and for a quadratic nonresidue. When , both sides are zero modulo .
For an odd prime , the Legendre symbol is zero if , one if is a nonzero quadratic residue modulo , and minus one if it is a quadratic nonresidue. Thus
It depends only on the congruence class of modulo .
For an odd prime , the Legendre symbol is
It 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 an odd prime , Euler's criterion states
For , 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 .
Quadratic nonresidue Created 2026-09-24 Updated 2026-10-18
A nonzero congruence class modulo an odd prime is a quadratic nonresidue when it is not a square. In the convention of quadratic residue, zero belongs to neither class. Thus are the quadratic nonresidues modulo seven, while are the quadratic nonresidues modulo eleven. No integer satisfies , as the complete square map under quadratic residue shows.
A quadratic nonresidue is not an arithmetic dead end: multiplying by any fixed quadratic nonresidue exchanges the quadratic residues and the quadratic nonresidues. If were a square for a square , division by would make a square. Hence consists entirely of quadratic nonresidues; it has elements, because multiplication by nonzero is a bijection. It therefore equals the entire other coset of the quadratic residue subgroup. Modulo seven, .
The product of two quadratic nonresidues is consequently a quadratic residue: write them as in that same coset, and their product is , a square. For example, , whereas remains a quadratic nonresidue. The multiplicativity of the Legendre symbol packages these rules as ordinary sign multiplication.
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]
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.
Figure 1.
Small prime square-residue tables distinguish opposite and equal Legendre symbol signs
. Each row uses half the nonzero inputs; the missing entries are unnecessary. The comparisons and are exact finite examples of quadratic reciprocity, not evidence by themselves for every prime pair. Details.
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]
Modulo seven, squaring the six nonzero congruence classes gives
Thus 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.
Figure 1.
The square map modulo seven and eleven: two inputs in every nonzero square fiber
. Each pair maps to one quadratic residue. The six nonzero inputs modulo seven give three outputs; the ten modulo eleven give five. The zero fiber is the single input zero, and each quadratic nonresidue has an empty fiber. Details.
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.