For distinct odd primes , quadratic reciprocity isThe usual supplementary laws areThe first supplement also follows immediately by inserting into Euler's criterion.
If have a common prime factor, both Jacobi symbols are zero, and the identity holds. Otherwise write , with multiplicity. All cross-pairs of primes are distinct. Multiplying quadratic reciprocity over these pairs givesThe exponent factors as a product of two sums. The parity identity from part (i) makes it congruent modulo two to . ThereforeThe same formula includes a denominator equal to one by the empty-product convention.
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 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
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 .
The primes both work, with the zero residue as a solution. For every other prime, multiplicativity of the Legendre symbol and quadratic reciprocity giveThe first factor is positive for ; the second is positive for . They must have the same sign. The Chinese remainder theorem therefore yields
For odd , quadratic reciprocity has no sign factor because :The nonzero squares modulo are , so the answer for odd primes is . The excluded-prime wording also allows , where has a square root. Thus the full answer is
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
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 .
Let with primes and . quadratic reciprocity makes three a square modulo ; choose and impose , by the Chinese remainder theorem. The curve has good reduction at both primes. Indeed its discriminant is ; the first condition could make a factor vanish only at or 11, while the second gives and the given residue class excludes .
Doubling gives . This vanishes modulo and equals one modulo . Modulo one also has , so and is the identity. Modulo the addition is finite. Thus computing modulo encounters a denominator whose greatest common divisor with is exactly , revealing the factor. The numerator difference is minus two modulo , so the failed inverse cannot be cancelled. This is a construction of successful elliptic curve method data from prescribed local group behavior.
Necessity follows by reducing modulo three. For a prime , quadratic reciprocity gives , so the discriminant criterion for prime representation by a binary quadratic form constructs a primitive positive definite form of discriminant of a binary quadratic form representing . Reduction gives and . The only primitive reduced form is : the alternatives are not primitive. Integral equivalence preserves represented integers, establishing sufficiency.
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]
