I’m attempting to prove the following:

If $p$ is an odd prime and $a$ is a positive integer such that $p \space \nmid \space a$ then the following expression holds:

$$(\frac{a}{p}) + (\frac{2a}{p}) +( \frac{3a}{p}) + \ldots + (\frac{(p-1)a}{p}) = 0$$

Where $(\frac{a}{p})$ represents the Legendre symbol. So far I tried working with Euler’s Criterion, but I haven’t had any luck. I’m feeling like I’m missing something that may be obvious. I’d be grateful for any help offered.

## Best Answer

Note that $\left(\frac{ab}{p}\right)=\left(\frac{a}{p}\right)\left(\frac{b}{p}\right)$; hence our sum is $$\left(\frac{a}{p}\right)\sum_{b=1}^{p-1}\left(\frac bp\right).$$ Notice that the summation is zero, since the number of quadratic residues modulo $p$ is simply $(p-1)/2$.