# Legendre symbol sum $\sum\limits_{x=4}^{p-1} \left(\frac{x(1-p-x)}{p}\right)$

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.

## 2 Answers

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$$.

• and you simplified $(2/p)$ because it is given by $p\bmod 8$ – reuns Dec 20 '19 at 14:23
• @reuns: right, $p\equiv 7\pmod 8$ implies $(2/p)=1$. – W-t-P Dec 20 '19 at 14:25
• @129492: Is the computation clear? If so, please, consider accepting the answer. – W-t-P Dec 21 '19 at 19:16

Let $$S$$ be your sum. Then $$S+p-4$$ is the number of solutions in $$\mathbb{F}_p^2$$ of $$y^2=x(1-x)$$ with $$x \neq 0,1,2,3$$.

There is exactly one solution if $$x=0$$ or $$x=1$$, for $$x=2$$ the equation is about $$y^2=-2$$ which is impossible (since $$8|p-7$$), and for $$x=3$$ the equation is $$y^2=-6$$. Since $$2$$ is a square in $$\mathbb{F}_p$$, this equation has the same number of solutions as $$y^2=-3$$. By quadratic reciprocity, we can see that $$\left(\frac{p}{3}\right)=\left(\frac{-3}{p}\right)$$.

As a consequence, $$S+p-1+\left(\frac{p}{3}\right)$$ is the number of solutions in $$\mathbb{F}_p^2$$ of $$y^2=x(1-x)$$.

Define, for a point $$P=(x,y) \neq O=(0,0)$$, $$t(P)=\frac{y}{x} \in \mathbb{F}_p^{\times}$$.

Define, for a $$t \in \mathbb{F}_p^{\times}$$, $$x(t)=\frac{1}{t^2+1}$$, $$y(t)=tx$$ and $$Q(t)=(x(t),y(t))$$. One easily checks that $$t(Q(t))=t$$ and $$Q(t(P))=P$$ for a nonzero point on the curve. Thus the equation has $$p$$ solutions in total.

Therefore, $$S+p-1+\left(\frac{p}{3}\right)=p$$, ie $$S=1-\left(\frac{p}{3}\right)$$.