4

I was going to break up $p$ into $8k+1$ and $8k+7$. Using this, I can plug that in for p and then solve using this.

Stefan4024
  • 36,357
sam
  • 101
  • 3

1 Answers1

2

Here is a proof that $\left( \frac{2}{p} \right) = (-1)^{(p^2-1)/8}$, which is basically what you are looking for:

Legendre symbol, second supplementary law

This says that $2$ is a quadratic residue $\bmod{p}$ if and only if $(p^2-1)/8$ is even. (Saying that $2$ is a quadratic residue is the same as saying that there is a solution to $x^2 \equiv 2 \pmod{p}$.) It is not difficult to check that: $(p^2-1)/8 = (p-1)(p+1)/8$ is even iff one of the factors $p-1,p+1$ is divisible by $8$.