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]
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.
Second supplementary law for quadratic reciprocity Created 2026-09-24 Updated 2026-11-05
For every odd prime , the Legendre symbol of isThus is a quadratic residue for and a quadratic nonresidue for .
Square root of minus one modulo a prime Created 2026-10-07 Updated 2026-11-05
For an odd prime , any solution is nonzero modulo . Fermat's little theorem givesso is even and . Conversely, put when . Pairing opposite factors in the factorial givesWilson's theorem therefore gives , constructing a solution. For example, at the construction gives and . The criterion is the first supplementary law for quadratic reciprocity expressed as existence of a square root.
For a multiplicative monoid automorphism fixing , define . This transports a semiring structure to the fixed underlying multiplication, hence a commutative-monoid enrichment on its one-object category. Swapping prime with an odd prime gives . Infinitely many such primes therefore give infinitely many distinct additions, although the transported enriched categories are isomorphic.
Two distinguished classes of discriminant minus eight q Created 2026-09-24 Updated 2026-11-05
For an odd prime , the formsare primitive binary quadratic forms of discriminant of a binary quadratic form . Their diagonal polynomial coefficients are positive, so they are positive definite, and makes both satisfy the reduced positive definite binary quadratic form inequalities.
Their proper equivalence classes are distinct. The first represents one at , but the second has minimum positive value two: if , , while and give at least two. Since proper equivalence preserves represented integers, the two forms cannot be equivalent.
Thus . If the class number of a negative discriminant is exactly two, these are all its primitive proper classes. That completeness hypothesis is the reason a local square test can select one specific form in prime representation when h of minus eight q equals two.
Weighted complete Legendre-symbol sum Created 2026-09-24 Updated 2026-11-05
For the first statement, the first supplementary law for quadratic reciprocity gives , where is the Legendre symbol. Pairing with givesThe same pairing in the complete Legendre-symbol sum shows that this half sum is zero, proving the exact equality.
For the second statement, multiplication by permutes the nonzero residue classes modulo . Reducing the weighted sum modulo and using multiplicativity of the Legendre symbol therefore gives . The coefficient is either or , and hence is invertible for . Thus . The restriction is necessary: at , .

