Definition:Legendre Symbol/Definition 2

Definition
Let $p$ be an odd prime.

Let $a \in \Z$.

The Legendre symbol $\paren {\dfrac a p}$ is defined as:
 * $\paren {\dfrac a p} := \begin{cases}

+1 & : a \not \equiv 0 \pmod p \land \exists b \in \Z : a \equiv b^2 \pmod p \\ 0 & : a \equiv 0 \pmod p \\ -1 & : a \not \equiv 0 \pmod p \land \not \exists b \in \Z : a \equiv b^2 \pmod p \\ \end{cases}$ where $x \bmod y$ denotes the modulo operation.

Also see

 * Equivalence of Definitions of Legendre Symbol