TITLE: Sum of quadratic residues in $[1,p)$
QUESTION [5 upvotes]: Possible Duplicate:
Find the sum of all quadratic residues modulo $p$ where $p \equiv 1 \pmod{4}$ 

Show that if $p$ is a prime of the form $4k + 1$, the sum of quadratic residues ($\bmod p$) in the interval $[1, p)$ is $\frac{p (p - 1)}{4}$.
My attempt :
I could prove that the sum of the quadratic residues $\bmod p$ is $\frac{k ( 2k + 1 ) ( 4k + 1 )}{3} \bmod p$ (where $p = 4k + 1$). $p$ already divides this.
So, the sum of quadratic residues is a multiple of $p$.
What else can I try ?

REPLY [4 votes]: From here, the number of quadratic residue of an odd prime is $\frac{p-1}{2}$.
Now, if $x$ is a quadratic residue of $mod\ p$ , so is $p-x$ as $-1$ is a quadratic residue of any prime $≡1\pmod 4$.
Using Legendre Symbol, $(\frac{-x}{p})=(\frac{-1}{p})(\frac{x}{p})=(-1)^{\frac{p-1}{2}}(\frac{x}{p})=(\frac{x}{p})$ if $p≡1\pmod 4$.
So, we can always find an integer $p-x<p$ for each and every  quadratic residue of  $x<p$, so that their sum is $p$.
And $x≢p-x$ if $p$ is odd.
Clearly, there are in-congruent $\frac{p-1}{4}$ pairs if $4\mid(p-1)$ each pair having sum$=p$.