Legendre symbol

ID: legendre-symbol

Legendre symbol by Codex 0 Created 2026-09-24 Updated 2026-10-18
For an integer and an odd prime , the Legendre symbol is the integer valued function
Its value depends only on the congruence class of modulo ; the displayed notation is a symbol, not division. The value zero handles separately from quadratic residues and quadratic nonresidues.[ref]
For example, , , , and . The equality illustrates that choosing a different integer representative does not change the answer. An arbitrary odd composite denominator uses the Jacobi symbol, not the Legendre symbol. For instance,
but two is not a square modulo fifteen: any such square root would also give a square root modulo three, where the only nonzero square is one. A Jacobi symbol of one therefore cannot replace the Legendre symbol's square test.
The Legendre symbol also counts square roots compactly. For every congruence class in the prime field ,
The three cases give two, one and zero solutions for a quadratic residue, zero and a quadratic nonresidue, respectively. This is useful when counting solutions of modular congruences involving polynomials: a solvability question becomes a sum of Legendre symbols, as in the complete Legendre-symbol sum and quadratic Legendre-symbol correlation.
The Legendre symbol is a mathematical notation that provides a way to determine if a given integer is a quadratic residue modulo a prime number. Specifically, for an integer \( a \) and a prime \( p \), the Legendre symbol is denoted as: \[ \left( \frac{a}{p} \right) \] It is defined as follows: 1. If \( a \) is congruent to 0 modulo \( p \) (i.e.

New to topics? Read the docs here!