If a prime divides the hypotenuse of a primitive Pythagorean triple, then $p \equiv 1$ (mod 4)

As the title implies.

I'm proving it by contradiction and I've already ruled out $p \equiv 0$ and $2$ (mod $4$).

I'm having trouble proving that it cannot be $\equiv 3$ (mod $4$). Namely, if $p \equiv 3$ (mod 4), then $m^2 + n^2 \equiv 1$ or $3$ (mod $4$). I know that $m^2 + n^2$ cannot be congruent to $3$ (mod $4$); but what about $1$?

Thank you.


Solution 1:

The appropriate proof depends on how much you know. We will use the fact that if $p$ is a prime of the form $4k+3$, then the congruence $x^2\equiv -1\pmod{p}$ does not have a solution.

Now suppose that the prime $p$ divides $s^2+t^2$, where $s$ and $t$ are relatively prime. The prime $p$ cannot divide $s$, else it would divide $t$,

So $s$ has an inverse modulo $p$, say $w$.

We have $s^2+t^2\equiv 0\pmod{p}$. Multiplying by $w^2$, we get that $(ws)^2+(wt)^2\equiv 0\pmod{p}$. Since $ws\equiv 1\pmod p$, it follows that $(wt)^2\equiv -1\pmod{p}$. Since the congruence $x^2\equiv -1\pmod{p}$ does not have a solution if $p$ is of the form $4k+3$, it follows that $p$ cannot be of that form.