Definition:Legendre Symbol

Definition
Let $p$ be an odd prime.

Let $a \in \Z$.

Then:
 * $\left({\dfrac a p}\right) := a^{\frac{(p - 1)} 2} \pmod p$

From Values of Legendre Symbol, we have that:
 * $\left({\dfrac a p}\right) = \begin{cases}

0& : a \equiv 0 \pmod p \\ +1 & : a \not \equiv 0 \pmod p \text{ and for some integer }x, x^2 \equiv \;a \pmod p \\ -1 & : \text{if there is no such } x \end{cases}$

From Euler's Criterion, this can be seen to be equivalent to:


 * $\left({\frac a p}\right) = \begin{cases}

0 & : a \equiv 0 \pmod p \\ +1 & : a \text{ is a quadratic residue of } p \\ -1 & : a \text{ is a quadratic non-residue of } p \end{cases}$

For a given $p$, the Legendre symbol is usually treated as a function $f_p: \Z \to \left\{{-1, 0, 1}\right\}$.

Applications
The Legendre Symbol can be used as a tool to finding whether a number is a quadratic residue (mod $p$) through the following conditions:


 * $\left({\dfrac a p}\right) = 1$ $a$ is a quadratic residue mod $p$
 * $\left({\dfrac a p}\right) = -1$ $a$ is a Quadratic non-residue mod $p$.

This follows directly from the definitions of quadratic residue and quadratic non-residue, and Euler's Criterion.

Also see

 * Law of Quadratic Reciprocity
 * Properties of Legendre Symbol