Solution (source code)

= Solution

Suppose only finitely many primes $q_1,\ldots,q_r$ are congruent to $7$ modulo $8$, and set
$$
n=8q_1\cdots q_r.
$$
Then
$$
M=\frac{n^2-2}{2}\equiv7\pmod8.
$$
If an odd prime $q$ divides $M$, then $n^2\equiv2\pmod q$, so part (a) gives
$$
q\equiv1\text{ or }7\pmod8.
$$
Since their product $M$ is $7$ modulo $8$, at least one prime divisor $q$ is $7$ modulo $8$ to an odd power. Yet no listed $q_i$ divides $M$, because $n\equiv0\pmod{q_i}$ gives
$$
M\equiv-1\pmod{q_i}.
$$
This produces a new prime congruent to $7$ modulo $8$, a contradiction. Hence
$$
\boxed{\pi_7(x)\longrightarrow\infty}.
$$
This is the <Euclid proof for infinitely many primes congruent to seven modulo eight>.