I'm working on the following problem that is using the Legendre Symbol:
Show that $$\left(\frac{2}{p}\right) = \large(-1)^{\frac{p^2-1}{8}\large}$$
So I know that $\left(\frac{2}{p}\right) = \left\{ \begin{array}{ll} 1 &\text{if }\>\>p\equiv\pm1\>\text{ mod }8\\ -1 &\text{if }\>\>p\equiv\pm3\>\text{ mod }8 \end{array} \right.$
But I'm not sure how to use this for the proof (assuming it's relevant).
Whether it's $1$ or $-1$ will depend on if the exponent is even or odd.
I'm not sure how to tie that all together. Any pointers?