# Legendre symbol identity: $\sum_{a=1}^{p-1}a \cdot (\frac{a}{p} )$ and $\sum_{a=1}^{p-1}2^a \cdot (\frac{a}{p} )$

I am trying to solve the following problems ($$p$$ is an odd prime).

1. Find the sum $$\sum_{a=1}^{p-1}a \cdot \left (\frac{a}{p} \right),$$
2. Find the sum $$\sum_{a=1}^{p-1} 2^a \cdot \left (\frac{a}{p} \right).$$

Some thoughts :

1. I reduced the sum to $$2S_P-\frac{p(p-1)}{2}$$ where $$S_p$$ is the sum of the quadratic residues modulo $$p$$ but I don't know how to evaluate it .
2. Nothing so far but more generally what can we say about the polynomial :

$$f(x)=\sum_{a=1}^{p-1} x^a \cdot \left (\frac{a}{p} \right)$$

Is this polynomial interesting in any way ?

Thanks for all the help .

• How did you reduce such sum? – Paolo Leonetti Aug 24 '15 at 21:47
• Are you interested in computing the sums $\pmod{p}$ or in finding their exact values? In the first case, notice that $$\sum a\left(\frac{a}{p}\right) = \sum a^{\frac{p+1}{2}}.$$ – Jack D'Aurizio Aug 24 '15 at 21:56
• For the case when $p \equiv 1 \pmod{4}$ it's easy to get (using a little symmetry) $S_p=\frac{p(p-1)}{4}$ so the sum is $0$ but I can't find a nice answer for $p \equiv 3 \pmod{4}$ . – user252450 Aug 24 '15 at 21:57
• @ Jack D'Aurizio I am asking for the exact values . As for number $2$ I think I am too optimistic to think there is a nice closed form . The polynomial looks interesting and maybe has some general nice properties . What do you think ? – user252450 Aug 24 '15 at 22:01
• and you should look at en.wikipedia.org/wiki/Proofs_of_quadratic_reciprocity – reuns Mar 31 '16 at 16:57