Congruence-What is remainder when $a^2+2b$ is divided 3? Suppose $a\equiv 7 \pmod 9 $, $b\equiv 1\pmod 6$. What is remainder when $a^2+2b$ is divided by 3 ?----- So, since $a=9m+7$, $b=6n+1$, $m,n\in \mathbb{Z}$, $a^2+2b=(9m+7)^2+2(6n+1)$,=$81m^2+12n+177$=$3(27m^2+4n+59)$....I am not sure what I am getting here.. Can I say the remainder is $0$? 

Another solution using the properties of modular arithmetic.
$a \equiv 7 \pmod 9 \Rightarrow a^2 \equiv 49 \equiv 4 \pmod 9$
$b \equiv 1 \pmod 6 \Rightarrow 2b \equiv 2 \pmod 6$
So $a^2 = 9n + 4$ and $2b = 6m + 2$, thus $a^2 + 2b = 9n + 6m + 6 = 3(3n + 2m + 2)$ which is definitely divisible by 3.
