If $x^2+y^2=z^2$, why can't $x$ and $y$ both be odd?

4.6k Views Asked by At

What does the following mean: If $x^2 + y^2 = z^2$ some integers $z$, then $x$ and $y$ can't be both odd (otherwise, the sum of their squares would be $2$ modulo $4$, which can't be a square). So, one of them must be even?

I see that if $x$ and $y$ are both odd, then $z^2 = 4k+2 =2(2k+1)$. So $z^2$ is even. But why does it say above that... can't be square?

3

There are 3 best solutions below

0
On BEST ANSWER

If $n = 2k$, then $n^2 = 4k^2$ is a multiple of $4$.

Likewise, if $n = 2k+1$, then $n^2 = 4(k^2 + k) + 1$.

Therefore, a square is congruent to either $0$ or $1 \pmod{4}$. In other words, a square is never of the form $4k + 2$, for some $k$.

More specifically, since you've seen that $x^2 + y^2 \equiv 2 \pmod{4}$ when $x$ and $y$ are odd, and since squares are never congruent to $2 \pmod{4}$, this shows that $x^2 + y^2$ is never a square when $x$ and $y$ are both odd.

4
On

Working modulo $4$, $0^2\equiv 2^2 \equiv 0 \pmod {4}$. This means that all even squares are multiples of $4$. But if $x$ and $y$ were both odd, $x^2+y^2\equiv 2 \pmod 4$, which cannot be a square. You can try squaring small even numbers and note that all the squares are multiples of $4$

0
On

Alvoutila- they have shown you that squares of even numbers are multiples of 4, and that squares of odd numbers are of form $4k+1$... Summing two of the latter will result in number $(4k+1)+(4l+1) = 4(k+l)+2$, and that cannot be neither square of even number (not a multiplier of 4) nor of odd number (of form $4m+1$ and not $4m+2$).