# Deduce that $\left(\frac{2}{p}\right)=(-1)^{\frac{1}{2}(p-1)-k}$

Let $p$ be an odd prime. Consider the numbers $$2 \cdot 1,2 \cdot 2,\dots,2\cdot \frac{1}{2}(p-1)$$

and let $k$ be the largest integer that satsifies $$2k \le \frac{1}{2}(p-1)$$

Prove that if $l \in \mathbb{Z}$ satisfies $k \lt l \lt \frac{1}{2}(p-1)$ then $2l-p$ is negative and is the least residue of $2l$. Deduce that $$\left(\frac{2}{p}\right)=(-1)^{\frac{1}{2}(p-1)-k}$$

I feel like i need to use Gauss' lemma but i'm not sure how i would show that the number of numbers with negative least residue is equal to $\frac{1}{2}(p-1)-k$

• Do you know about the lemma of Gauss? – Prasun Biswas Feb 5 '18 at 22:49
• Yes i am aware of the lemma. I am struggling to show that the number of numbers with negative least residue is equal to $\frac{1}{2}(p-1)-k$ as i feel this would be sufficient alongside Gauss' Lemma – MathDeg Feb 5 '18 at 22:56
• Can you show that for $m\gt k$, we have $2m\gt\frac p2$ ? – Prasun Biswas Feb 5 '18 at 23:12
• Notice that the integer after $\dfrac{p-1}2$ is $\dfrac{p+1}2$ which is $\gt\dfrac p2$ – Prasun Biswas Feb 5 '18 at 23:17
• Also, there are exactly $\dfrac{p-1}2$ quadratic residues modulo odd prime $p$ – Prasun Biswas Feb 5 '18 at 23:18