To show that $\sum_{a=1}^{p-2}(a(a+1)/p)=-1$ Let $p$ be an odd prime and for any integer $a$ , relatively prime to $p$ , let $(a/p)$ denote the Legendre symbol . Then how to show that $\sum_{a=1}^{p-2}(a(a+1)/p)=-1$ ? 
I know that $\sum_{a=1}^{p-1}(a/p)=0$ , so it is enough to show that modulo $p$ , the integers $a(a+1) ; a=1,...,p-2$ runs through a complete set of non-zero residues modulo $p$ except exactly one quadratic residue mod $p$ . But I am unable to show this . Please help . Thanks in advance 
 A: Notice that
$$ \newcommand{\kron}[2]{\left( \frac{#1}{#2} \right)}$$
$$ \sum_{1 \leq a \leq p-2} \kron{a(a+1)}{p} = \sum_{1 \leq a \leq p-2} \kron{a^2}{p} \kron{1 + a^{-1}}{p} = \sum_{1 \leq a \leq p-2} \kron{1 + a^{-1}}{p}.$$
We are pivotally using that every nonzero element has an inverse mod $p$.
As $a$ runs through $1$ to $p-2$, its inverse $a^{-1}$ also runs through the inverses of every element except for $p-1 = -1$. Thus
$$ \sum_{1 \leq a \leq p-2} \kron{1 + a^{-1}}{p} = \sum_{1 \leq b \leq p-2} \kron{1 +b}{p} = \sum_{2 \leq c \leq p-1} \kron{c}{p}.$$
This last sum is only missing $\kron{1}{p}$ from being a complete sum over the finite field. Since we know that
$$ \sum_{1 \leq x \leq p-1} \kron{x}{p} = 0,$$
we have that
$$ \kron{1}{p} + \sum_{2 \leq c \leq p-1} \kron{c}{p} = 1 + \sum_{2 \leq c \leq p-1} \kron{c}{p} = 0 \implies \sum_{2 \leq c \leq p-1} \kron{c}{p} = -1,$$
as we set out to show. $\diamondsuit$
A: Ah , I think I got it . 
For every $1\le a \le p-1 , \exists $ unique $1\le a' \le p-1$ such that $aa'\equiv 1(mod \space p) $ . Now for $1 \le a \le p-2$ , gcd$(p.a(a+1))=1$
So for $1\le a \le p-2$ , 
$(a(a+1)/p))=(a(a+aa')/p)=(a^2(1+a')/p)=(a^2/p)((1+a')/p)=((1+a')/p)$ , 
and since $p-1$ is the inverse of itself modulo $p$ , so for $1\le a \le p-2$ , the distinct inverses $a'$ run through the residue system $\{1,...,p-2\}$ . Hence
$\sum_{a=1}^{p-2}(a(a+1)/p)=\sum_{a'=1}^{p-2}((a'+1)/p)=\sum_{m=2}^{p-1}(m/p)=0-(1/p)=-1$
