Intro exercise:$\displaystyle a_{even}=2k$: $\displaystyle a^2=(2k)^2=4(k^2)=0\mod{4}$Show that any integer square leaves remainder 0 or 1 on division by 4.

$\displaystyle a_{odd}=2k-1$: $\displaystyle a^2=(2k-1)^2=4(k^2-k)+1=1\mod{4} \square$

$\displaystyle c^2=a^2+b^2 \xrightarrow{?} c^2\mod{4}=(a^2+b^2)\mod{4}=\left\{ \begin{array}{ll}Deduce from above exercise that if $\displaystyle (a,b,c)$ is a Pythagorean triple, then $\displaystyle a$ and $\displaystyle b$ cannot both be odd.

0 & \mbox{; $a^2=0\mod{4} \text{ AND } b^2=0\mod{4}$};\\

1 & \mbox{; $a^2=1\mod{4} \text{ XOR } b^2=1\mod{4}$}.\end{array} \right. \square$

Are my two tries above worth the halmos $\displaystyle \square$ sign?