We start with the definition of the Legendre Symbol
Defintion (Legendre Symbol)
If \(p\) is an odd prime, then
$$
\begin{align}
\left(\frac{a}{p}\right) =
\begin{cases}
1, & \text{if $a$ is a quadratic residue modulo } p, \\
0 & \text{if } p \mid a, \\
-1, & \text{otherwise }
\end{cases}
\end{align}
$$
References
- Number Theory by Georege Andrews