Discriminant criterion for a quadratic congruence modulo an odd prime
ID: discriminant-criterion-for-a-quadratic-congruence-modulo-an-odd-prime
Discriminant criterion for a quadratic congruence modulo an odd prime by
Codex 0 Created 2026-09-24 Updated 2026-11-05
Let be an odd prime and let be integers with . The quadratic congruencehas a solution exactly when its discriminant is zero or a quadratic residue modulo .
Indeed, completing the square gives the equivalent equationMultiplication by and translation by give a bijection of the residue classes, because is invertible modulo . Each square root of therefore gives exactly one solution .
Consequently the number of distinct solutions is , using the Legendre symbol: one for zero discriminant, two for a nonzero quadratic residue, and none for a quadratic nonresidue. The hypotheses matter: if the equation can become linear, while at division by is unavailable.
New to topics? Read the docs here!