The first supplementary law for quadratic reciprocity isIt also follows immediately from Euler's criterion applied to .
Write . If , both sides of the proposed identity are zero. Otherwise . The multiplicativity of the Legendre symbol and Euler's criterion giveFor the middle equality, Euler's congruence determines the sign exactly, since both the symbol and are in and is odd.
Euler's criterion statesFor , the sign is precisely for a quadratic residue and for a quadratic nonresidue. For , both sides are zero.
Again . By Euler's criterion, . If , the exponent is even and the answer is one. If , it is odd and the answer is . Hence
Euler's criterion states that for ,For a multiple of , both the Legendre symbol and that positive power vanish modulo , so the congruence extends to that case as well.
Euler's criterion gives . The Legendre symbol is multiplicative, so multiplying this sign by the result of (iv) yields
For distinct odd primes , quadratic reciprocity isThe usual supplementary laws areThe first supplement also follows immediately by inserting into Euler's criterion.
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 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 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 .
Pépin's test 2026-10-14
For , Pépin's test says that the Fermat number is a prime number exactly when the displayed modular congruence holds. Modular exponentiation evaluates it by exponentiation by squaring without constructing the enormous ordinary power. The index restriction excludes , where the base itself is divisible by the candidate.[ref]
For a proof outline of sufficiency, any prime factor of a passing candidate gives multiplicative order exactly , a power of two: its half-power is , rather than . Fermat's little theorem forces , so , and hence . Conversely, for a prime candidate, ; quadratic reciprocity and Euler's criterion give the required half-power. At , the check is .
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.
Solovay-Strassen primality test 2026-09-29
The Solovay-Strassen primality test samples unit bases and rejects an odd candidate as composite when it finds an Euler witness. Every prime passes every base by Euler's criterion, while an odd composite passes a random base with probability at most one half.
For , the first order bound already gives . The second supplementary law for quadratic reciprocity says that two is then a quadratic residue modulo . Euler's criterion gives , so its multiplicative order divides . Thus , further reducing the candidate factors. At , meets this bound. The restriction matters: has factor five, which is not one modulo eight.
