2.9.2

a) Let a be an integer, then a must be congruent to 0,1,2 or 3 modulo 4, by the division algorithm. We can explicitly compute what $$a^2$$ will be congruent to by using Lemma 2.9.6:

$$ a \equiv 0 \ mod \ 4 \implies a^2 \equiv 0^2{} \equiv 0 \ mod \ 4 $$

$$ a \equiv 1 \ mod \ 4 \implies a^2 \equiv 1^2{} \equiv 1 \ mod \ 4 $$

$$ a \equiv 2 \ mod \ 4 \implies a^2 \equiv 2^2{} \equiv 4 \equiv 0 \ mod \ 4 $$

$$ a \equiv 3 \ mod \ 4 \implies a^2 \equiv 3^2{} \equiv 9 \equiv 1 \ mod \ 4 $$

Hence, $$a^2$$ is congruent to 0 or 1 modulo 4.

b) Let a be an integer, then a is congruent to 0,1,2,3,4,5,6 or 7 modulo 8. Following the argument above, we have:

$$ a \equiv 0 \ mod \ 8 \implies a^2 \equiv 0^2{} \equiv 0 \ mod \ 8 $$

$$ a \equiv 1 \ mod \ 8 \implies a^2 \equiv 1^2{} \equiv 1 \ mod \ 8 $$

$$ a \equiv 2 \ mod \ 8 \implies a^2 \equiv 2^2{} \equiv 4 \ mod \ 8 $$

$$ a \equiv 3 \ mod \ 8 \implies a^2 \equiv 3^2{} \equiv 9 \equiv 1 \ mod \ 8 $$

$$ a \equiv 4 \ mod \ 8 \implies a^2 \equiv 4^2{} \equiv 16 \equiv 0 \ mod \ 8 $$

$$ a \equiv 5 \ mod \ 8 \implies a^2 \equiv 5^2{} \equiv 25 \equiv 1 \ mod \ 8 $$

$$ a \equiv 6 \ mod \ 8 \implies a^2 \equiv 6^2{} \equiv 36 \equiv 4 \ mod \ 8 $$

$$ a \equiv 7 \ mod \ 8 \implies a^2 \equiv 7^2{} \equiv 49 \equiv 1 \ mod \ 8 $$

Hence, $$a^2$$ is congruent to 0,1, or 4 modulo 8.