Quadratic Residues
Quadratic Residues
Quadratic residues are integers that are perfect squares modulo a given modulus. The study of quadratic residues is central to number theory and has applications in cryptography, primality testing, and the theory of quadratic forms.
The crown jewel of this theory is the Law of Quadratic Reciprocity, which Gauss called the golden theorem and proved multiple times using different methods.
Definition
Let
If no such solution exists,
Example
Modulo
So the quadratic residues mod
The Legendre Symbol
The Legendre symbol
Eulers Criterion
The Legendre symbol can be computed using Eulers criterion:
This follows from Fermat's little theorem:
Properties of the Legendre Symbol
The Legendre symbol is multiplicative:
This makes it a completely multiplicative function of
Special Values
When is -1 a Quadratic Residue?
So -1 is a quadratic residue mod p if and only if p is congruent to 1 mod 4.
When is 2 a Quadratic Residue?
So
The Law of Quadratic Reciprocity
Let
Equivalently,
This remarkable theorem allows us to compute Legendre symbols efficiently by reducing large numbers modulo small primes.
The Jacobi Symbol
The Jacobi symbol generalizes the Legendre symbol to composite odd moduli. For
The Jacobi symbol retains the multiplicativity and reciprocity properties, making it useful for computation even when we do not know the factorization of
Counting Quadratic Residues
Among the integers
This follows because the squaring map
Applications
Primality Testing
The Solovay-Strassen primality test uses the Jacobi symbol and Euler's criterion. If
Cryptography
Quadratic residuosity is the basis for several cryptographic systems. The Goldwasser-Micali cryptosystem uses the difficulty of distinguishing quadratic residues from nonresidues modulo a composite.
Solving Quadratic Congruences
To solve
Gaussian Periods and Gauss Sums
Gauss sums are exponential sums that encode information about quadratic residues:
Gauss showed that
Historical Note
Euler and Legendre studied quadratic residues and conjectured the reciprocity law. Gauss provided the first complete proof in 1796 at age 18, later giving seven more proofs using different methods.
Quadratic reciprocity inspired the search for higher reciprocity laws, leading to class field theory and modern algebraic number theory.
Algorithm for Computing Legendre Symbol
To compute
Reduce
Factor out powers of
For odd factors, use quadratic reciprocity to swap the arguments.
Reduce the arguments and repeat until the result is determined.
This is similar to the Euclidean algorithm and runs in polynomial time.
Distribution of Quadratic Residues
Quadratic residues are not randomly distributed. Consecutive quadratic residues and nonresidues exhibit patterns studied by number theorists.
The least quadratic nonresidue modulo
Quadratic residues form a fundamental concept connecting number theory, algebra, and cryptography, with the Law of Quadratic Reciprocity standing as one of the most beautiful theorems in mathematics.
Quadratic Character
The Legendre symbol defines a group homomorphism from the multiplicative group of integers mod