Suppose that $p$ is a prime with $p \equiv 7 \pmod 8$. If $t = \frac{p - 1}{2}$ , prove that $2^t \equiv 1 \pmod p$

Suppose that $p$ is a prime with $p \equiv 7 \pmod 8$. If $t = \frac{p - 1}{2}$ , prove that $$2^t \equiv 1 \pmod p.$$

Any hints will be appreciated. Thanks so much.

• Well, $2^{p-1} \equiv 1$ mod $p$ by Fermat's little theorem, so $2^t$ is congruent to either $1$ or $-1$. – D_S Oct 30 '16 at 4:30
• Why is that the case? – PropositionX Oct 30 '16 at 4:34
• If $x^2 \equiv 1 \pmod{p}$, then $(x-1)(x+1) \equiv 0$, so $p$, being prime, divides either $x-1$ or $x+1$. That's the same as saying that $x$ is congruent to $\pm 1$. – D_S Oct 30 '16 at 4:35
• Sorry I still do not understand why that is related to this problem. – PropositionX Oct 30 '16 at 4:42
• I haven't solved this problem yet, but I'm just saying that whatever $2^t$ is modulo $p$, you can narrow it down to two possibilities: what you want, and $-1$. – D_S Oct 30 '16 at 4:47

Obviously $p$ is odd.
It is well known that $$\left(\dfrac 2p\right)=(-1)^{\frac{p^2-1}{8}}$$ where $\left(\dfrac ap\right)$ is the Legendre's symbol.
On the other hand $$p=8m+7\Rightarrow p^2-1=64m^2+112m+48\Rightarrow\frac{p^2-1}{8}=8m^2+14m+6\in 2\Bbb Z$$
It follows (because $\frac{p^2-1}{8}$ is even) $$\left(\dfrac 2p\right)= 1$$ which means that $2$ is a square modulo $p$.
Thus $$\left(2\right)^{\frac{p-1}{2}}=\left(x^2\right)^{\frac{p-1}{2}}=x^{p-1}\equiv 1\pmod p$$
Let $\alpha$ denote a primitive $8$th root of unity in an algebraic closure of $\mathbb F_p$. The element $y=\alpha+\alpha^{-1}$ verifies $y^2=2$ for $y^4=-1$ hence $\alpha^2+\alpha^{-2}=0$. Consequently, $2^{(p-1)/2}=y^{p-1}$. Note also that $y^p=\alpha^p+\alpha^{-p}$. If $p\equiv -1\pmod 8$ then $y^p=y$, hence $2^{(p-1)/2}=y^{p-1}=1$.