\(\textbf{Definition. }\)Let \(p\) be a prime. Let \(a\in\mathbb{Z}\), we define \[ \left(\frac{a}{p}\right) = \begin{cases} 1 \qquad\text{if } a\text{ is a square in } (\mathbb{Z}/p\mathbb{Z})^\times,\\ -1 \qquad\text{if } a\text{ is not a square in} (\mathbb{Z}/p\mathbb{Z})^\times,\\ 0 \qquad\text{if } a\text{ is }0\in\mathbb{Z}/p\mathbb{Z}\; (i.e. p\mid a). \end{cases} \]
\(\textbf{Theorem. }\)Let \(p\) be a prime. Let \(a=-1\in\mathbb{Z}\), we have \[ \left(\frac{-1}{p}\right) = \begin{cases} 1 \qquad\text{if } p\equiv 1\mathrm{mod }4\\ -1 \qquad\text{if } p\equiv 3\mathrm{mod }4\\ \end{cases} \]
\(\textbf{Theorem. }\)Let \(p\) be a prime. Let \(a=2\in\mathbb{Z}\), we have \[ \left(\frac{2}{p}\right) = \begin{cases} 1 \qquad\text{if } p\equiv \pm 1\mathrm{mod }8\\ -1 \qquad\text{if } p\equiv \pm 3\mathrm{mod }8\\ \end{cases} \]
\(\textbf{Proposition. }\)If \(p\equiv \pm 3\mathrm{mod }8\), then \(\left(\frac{2}{p}\right) = -1\).
\(\textbf{Proof. }\)Suppose otherwise. By Wop, there is a smallest prime \(p\) such that \(\left(\frac{2}{q}\right) = 1\). We can choose \(x\in\mathbb{Z}\) with \[ x^2\equiv 2\mathrm{mod }p. \] We can assume that \(0\lt x\lt p\) and \(x\) is odd. We have \(p\mid x^2-2\), which means there exists \(k\in\mathbb{Z}\) such that \[ x^2-2 = kp. \] Then, \[ 0\lt pk = x^2 -2 \lt p^2. \] Thus, \[ 0\lt k\lt p. \] We investigate \(k\mathrm{mod }8\). \[ pk = x^2-2 \] \[ \pm3 k\equiv -1\mathrm{mod }8. \] So \[ k = \pm 3\mathrm{mod }8. \] Let \(q\) be a prime divisor of \(k\). Then, \[ q\leq k\lt p, so q\lt p. \] We have choose \(q\equiv \pm 3\mathrm{mod }8\). Otherwise, every prime dividing \(k\) is congruent to \(\pm 1\mathrm{mod }8\). Then, it force \(k\equiv \pm 1\mathrm{mod }8\), which is a contradiction. Since \(q\mid k\) and \(x^2-2=pk\), we have \[ x^2\equiv 2\mathrm{mod }q. \] Thus, \[ \left(\frac{2}{q}\right) = 1. \] This is a contradiction. \(\blacksquare\)
\(\textbf{Proposition. }\)If \(p\equiv 5\mathrm{mod }8\) or \(p\equiv 7\mathrm{mod }8\), then \(\left(\frac{-2}{p}\right) = -1\).
\(\textbf{Proof. }\)Same approach.
\(\textbf{Claim. }\)If \(p\equiv 1\mathrm{mod }8\), then there exists an \(\omega\in\mathbb{Z}/p\mathbb{Z}\) such that \[ \omega^4+1 \equiv 0\mathrm{mod }p. \]