I am studying the sums of Legendre symbol and I have a question about it.
Let $p$ is a prime number, $p >7$, $p\equiv 7 \pmod 8$. Find $$\sum_{x=4}^{p-1} \left(\frac{x(1-p-x)}{p}\right).$$ I had some basic background working with Legendre symbols but not with sums of series. Any help is appreciated.
The corresponding complete sum, where $x$ runs over all integers from $0$ to $p-1$, is \begin{align*} S &= \sum_{x=0}^{p-1} \left(\frac{x(1-x)}{p}\right) \\ &= \sum_{x=1}^{p-1} \left(\frac{x(1-x)/x^2}{p}\right) \\ &= \sum_{x=1}^{p-1} \left(\frac{(1/x)-1}{p}\right) \\ &= \sum_{y=1}^{p-1} \left(\frac{y-1}{p}\right) \\ &= \sum_{y=0}^{p-1} \left(\frac{y-1}{p}\right) - \left(\frac{-1}{p}\right) \\ &= - \left(\frac{-1}{p}\right) \\ &= 1 \end{align*} (where all divisions are in $\mathbb F_p$, and where $y=1/x$). It follows that the original incomplete sum is $$ 1 - \left(\frac{2(1-2)}{p}\right) - \left(\frac{3(1-3)}{p}\right) = 1 + \left(\frac{2}{p}\right) + \left(\frac{6}{p}\right) = 2 + \left(\frac{3}{p}\right). $$ Notice that the value of $(3/p)$ is determined by the residues class of $p$ modulo $3$.