sum of quadratic residues for $p=8k+7$ I have a question concerning the sum of quadratic residues in $[-p',p']$ for $p=8k+7$ where $p'=(p-1)/2$. The answer seems to be $0$ for small cases: 
$$p=7:1+2-3=0$$
$$p=23: 1+4+9+2+3+6+8-7-10-5-11=0$$
 None of the number theory books I have read (Niven, Zuckerman and Vinogradov) have really considered this sum except for proving it is $0 \pmod p$ which is not that hard. Of course, there is a big chance of this hypothesis not being true so please provide a counterexample if you find one, or even better, a proof if you manage to prove this.
 A: The result is proven here, which I summarize below.
Suppose that $p = 8k + 7$. Let $Q$ be the set of quadratic residues in $[0,p]$, and $Q'$ the set of quadratic residues in $[-p',p']$.
Since $p \equiv 3 \pmod{4}$, we have that $-1$ is not a quadratic residue (this is proven here, for example). In particular, in the case when $p \equiv 3 \mod{4}$, we have that the negative (modulo $p$) of any residue is a non-residue, and the negative of any non-residue is a residue.
Let $n$ be the number of non-residues in $[0,p']$. It follows that there are $n$ residues in $[p',p]$. In particular, we have that $\sum Q' = \sum Q - np$. 
Now it suffices to show that $\sum Q = np$.
Let $\sigma:\mathbb{Z}_p \rightarrow \mathbb{Z}_p, x \mapsto 2x$. Notice that for $x \in [0,p']$, $\sigma(x) = 2x$ in $\mathbb{Z}$. For $x \in [p',p], \sigma(x) = 2x - p$ in $\mathbb{Z}$. Moreover, observe that $\sigma$ fixes $Q$, since $p \equiv 7 \mod{8}$. We hence have
$\sum Q = \sum \sigma(Q) = \sum_{x \in [0,p']} 2x + \sum_{x \in [p',p]} (2x - p) = 2\sum Q - np$.
$\implies \sum Q = np$
