Let $p>3$ be a prime.
We set $R=\{x\in\mathbb{Z}: (x/p)=1\}$, where $(\cdot/p)$ is the Legendre symbol. When $p\equiv3\pmod4$, by class formulae of imaginary quadratic fields $\mathbb{Q}(\sqrt{-p})$, we can easily obtain that
$$A\_p:=\sum\_{0<x<p/2,x\in R}x=(p^2-1)/16,\ \text{if}\ p\equiv7\pmod8,$$
and that
$$A\_p=\sum\_{0<x<p/2,x\in R}x=(p^2-1+8ph(-p))/16,\ \text{if}\ p\equiv3\pmod8,$$
where $h(-p)$ is the class number of $\mathbb{Q}(\sqrt{-p})$. However, in the case $p\equiv1\pmod4$
I can not get the explicit value of $$A\_p=\sum\_{0<x<p/2,x\in R}x.$$


Your comments are welcome.



On sums of quadratic residues
By standard formulas for values of L functions at negative integers, for
$p\equiv1\pmod4$ one has
$$A\_p=(p^2-1)/16+aL(\chi\_p,-1)\;,$$
with $a=3/4$ if $p\equiv1\pmod8$ and $a=5/4$ if $p\equiv5\pmod8$
where $\chi\_p(x)=(x/p)$.


