Show a,b,c congruences when $a^2+b^2=c^2$ i would like to know how to prove that if $a^2+b^2=c^2$ then 
a) $3|a$ or $3|b$ 
b) $5|a$ or $5|b$ or $5|c$ 
c) $4|a$ or $4|b$ 
Also that $a^2+b^2+c^2+1$ can't be divisible by 8
Thank you very much!
 A: (a)
(i)If $3\not\mid ab, a\equiv\pm1\pmod3,b\equiv\pm1\implies a^2+b^2\equiv1+1\equiv-1\pmod 3$ 
but $c\equiv\pm1,0\implies c^2\equiv1,0\pmod 3$
(ii)Alternatively, using this, $a=k(m^2-n^2),b=k(2mn),c=k(m^2+n^2)$ will generate all Pythagorean triples uniquely where m, n, and k are positive integers with m > n, m − n odd, and with m and n co-prime.
So, $ab=k2mn\cdot k(m^2-n^2)$
If $3\mid mn, 3\mid b$ we are done else  $(mn,3)=1$
Using Fermat's Little Theorem, 
$m^2\equiv1\pmod 3$ and $n^2\equiv1\implies 3\mid(m^2-n^2)\implies 3\mid a$
(b)
(i) If $5\not\mid ab, a\equiv\pm1,\pm2\pmod3 \implies a^2\equiv1,4\pmod 5$
Similarly, $b^2\equiv1,4\pmod 5$
Observe that $c\equiv0,\pm1,\pm2\pmod5\implies c^2\equiv0,1,4\pmod 5$
If $a\equiv\pm1,b\equiv\pm1, a^2+b^2\equiv2\pmod5$ which is not congruent to any square $\pmod 5$
If $a\equiv\pm2,b\equiv\pm2, a^2+b^2\equiv8\equiv3\pmod5$ which is not congruent to any square $\pmod 5$
So, either $a\equiv\pm2,b\equiv\pm1$ or $a\equiv\pm1,b\equiv\pm2$
(ii)In the alternate way, $a=k(m^2-n^2),b=k(2mn),c=k(m^2+n^2)$
So, $abc=k^32mn(m^4-n^4)$
If $5|m$ or $5|n$ we are done else $(mn,5)=1$
Using Fermat's Little Theorem, 
$m^4\equiv1\pmod 5$ and $n^4\equiv1\implies 5\mid(m^4-n^4)\implies 5\mid(m^2-n^2)$ or $5\mid(m^2+n^2)$
(c)$a=k(m^2-n^2),b=k(2mn),c=k(m^2+n^2)$
As $m-n$ is odd, $2\mid mn\implies 4\mid b$
The last problem :  Observe that the square of any number is $\equiv0,1,4\pmod 8$
A: Hints:
$$\forall n\in\Bbb Z\;\;,\;\;\;n^2=0,1\pmod 3\Longrightarrow a^2+b^2=c^2=0,1\pmod 3\Longrightarrow \ldots$$
Try now to come up with something similar as above for $\,p=4,5\,$
For the last one (and for (c), too), remember that $\,n^2=0,1\pmod 4\,$ , so...
A: Hint: Take the equation $a^2+b^2=c^2$ modulo 3. Also, note that
$$0^2\equiv 0\bmod 3,\qquad 1^2\equiv 1\bmod 3,\qquad 2^2\equiv 1\bmod 3,$$
and since any integer is equivalent modulo 3 to either 0, 1, or 2, we see that any square number, when taken modulo 3, cannot be equivalent to 2.
Do the same for the other moduli; work out the various cases according to what values $a^2$, $b^2$, and $c^2$ might take modulo $n$, rule out the cases that are impossible.
Also, keep in mind that if a prime number $p$ divides a square number $r^2$, then it must divide $r$.
A: a) $a^2=1 \;\text{or}\; 0 \pmod 3,\quad b^2=1 \;\text{or}\; 0 \pmod 3.\quad c^2=0 \;\text{or}\; 1 \mod(3).$
$ c^2$ can't be $0 \pmod 3$, which means $a^2+b^2=1$ or $0 \pmod 3$. Either $3|a \;\text{or}\; 3|b$..
b) $a^2=0,1 \;\text{or}\; 4 \pmod 5,\quad b^2=0,1 \;\text{or}\; 4 \pmod 5.\quad c^2=0,1 \;\text{or}\; 4 \pmod 5$.
$$a^2+b^2=0,1 \;\text{or} 4 \pmod 5.$$
Case 1: When 5 doesn't divide both 'a' and 'b',
$$a^2=1 \;\text{or}\; 4 \pmod 5 ,\quad b^2=4 \;\text{or}\; 1 \pmod 5$$.
Notice that, both can't $1$ or $4 \pmod 5$ simultaneously as $c^2=0,1 \;\text{or}\; 4 \pmod 5)$.
Therefore, $a^2+b^2=0 \pmod 5, \quad 5|c$.
Case 2: When $5$ doesn't divide $c$
$$c^2=1 \;\text{or}\; 4 \pmod 5$$
$$a^2=1,4 \;\text{or}\; 0 \pmod 5,\quad b^2=1, \quad 4 \;\text{or}\; 0 \pmod 5$$
$$a^2+b^2=1 \;\text{or}\; 4 \pmod 5 \text{, therefore, } 5|a \;\text{or}\; 5|b.$$
c) $a^2=1 \;\text{or}\; 0 \pmod 4, \; b^2=1 \;\text{or}\; 0 \pmod4, c^2=1 \;\text{or}\; 0 \pmod 4.$
Adding two squares is not $2 \pmod 4$.
Therefore, if $$c^2=1 \pmod 4.\quad 4|a \;\text{or}\; 4|b$$
$$c^2=0 \pmod 4. \quad 4|a \;\text{or}\; 4|b$$
Well, this is the most elementary solution to your problem.
