Euler's Criterion — Definition, Formula & Example
Euler's criterion is a test for whether a whole number has a square root modulo an odd prime. You raise the number to one specific power and check whether the remainder is 1 or −1.
Let be an odd prime and an integer with . Then if there exists an integer with (that is, is a quadratic residue), and otherwise. In Legendre-symbol form, for every integer . When , both sides are .
Key Formula
Where:
- = An odd prime modulus
- = The integer you are testing
- = The Legendre symbol. It is 1 if a is a nonzero quadratic residue mod p, −1 if a is a nonresidue, and 0 if p divides a
Worked Example
Problem: Use Euler's criterion to decide whether has a solution.
Step 1: Find the exponent. Since and , you need .
Step 2: Compute powers of 5 by repeated squaring. Reduce mod 19 after each squaring so the numbers stay small.
Step 3: Multiply one more factor of 5 to reach the ninth power. The remainder is 1, so 5 is a quadratic residue. As a check, .
Answer: Because , the number 5 is a quadratic residue mod 19. The congruence has the solutions and .
Why It Matters
Euler's criterion turns a search through all squares mod p into a single fast modular exponentiation. That speed makes it practical for large primes. The Solovay–Strassen primality test compares it against the Jacobi symbol, and many proofs of quadratic reciprocity in a first number theory course start from it.
Common Mistakes
Mistake: Raising a to the power p − 1 instead of (p − 1)/2.
Correction: By Fermat's little theorem, for every with . That result can't separate residues from nonresidues. Use the half exponent . Its result is or when , and when .
