Call a triple of integers $(a, b, c)$ a Pythagorean triple if $a^2 + b^2 = c^2$ , i.e., if $a, b, c \in \mathbb{N^*}$ are the (measures of) sides of a right triangle. Examples of Pythagorean triples are (3, 4, 5), (5, 12, 13), (8, 15, 17) and (3312, 16766, 17090).
Show that if $(a, b, c)$ is a Pythagorean triple if at least one of a and b is divisible by 3.
I think to begin with $a^2 + b^2 = c^2 \rightarrow a^2 - c^2 = b^2$ to show this. Then I get stuck to prove this?
A number that is not divisible by $3$ may be written either as $3m+1$ or as $3m+2$ for some integer $m$. The square of such a number is then $$ (3m+1)^2 = 9m^2 + 6m + 1 = 3(3m^2 + 2m) + 1\\ (3m + 2)^2 = 9m^2 + 12m + 4 = 3(3m^2 + 4m + 1) + 1 $$ and we see that the square of such a number is always of the form $3n+1$ for some integer $n$.
Now, assume that neither $a$ nor $b$ is divisible by $3$. Then by the above, we have $$ \color{red}{a^2} + \color{blue}{b^2} = \color{red}{3i + 1} + \color{blue}{3j + 1} = 3(i+j) + 2 $$ for some integers $i, j$. In other words, $a^2 + b^2$ will be $2$ more than some multiple of $3$. But on the other side of the equality sign we have $c^2$, which is either a multiple of $3$ or $1$ more than such a multiple. This is a contradiction, and therefore the assumption that neither $a$ nor $b$ is divisible by $3$ must be false.