Legendre symbol series

Given an odd prime $p$, prove that

$\sum\limits_{x=0}^{p-1}(\frac{x^2-1}{p}) \equiv -1$ $(mod$ $p)$

where $(\frac{a}{p})$ denotes the Legendre symbol. I tried using $(\frac{a}{p}) \equiv a^{\frac{p-1}{2}} (mod$ $p)$ when $a \not\equiv 0$ $(mod$ $p)$, but that got me no where.

1 Answer

For any integers $a,b,c$ and a prime $p∤a$, the sum $$\sum_{x=0}^{p-1}\left( \frac{ax^2+bx+c}{p}\right)$$ equals $-(\frac{a}{p})$, if $p\nmid b^2-4ac$, and $(p−1)(a/p)$ if $p∣(b^2−4ac)$. For $(a,b,c)=(1,0,-1)$ and $p\nmid 2$ we obtain that the sum equals $-1$, because $(1/p)=1$. For a proof see Theorem $19$ here.