remainder of $a^2+3a+4$ divided by 7 
If the remainder of $a$ is divided by $7$ is $6$, find the remainder when $a^2+3a+4$ is divided by 7
(A)$2$ (B)$3$ (C)$4$ (D)$5$ (E)$6$

if $a = 6$, then $6^2 + 3(6) + 4 = 58$, and $a^2+3a+4 \equiv 2 \pmod 7$
if $a = 13$, then $13^2 + 3(13) + 4 = 212$, and $a^2+3a+4 \equiv 2 \pmod 7$
thus, we can say that any number, $a$ that divided by 7 has remainder of 6, the remainder of $a^2 + 3a + 4$ is 2.
is there any other way to calculate it? (Let say it given b as the remainder of a divided by 7, not 6)

The remainder of $a^2+3a+4$ divided by $7$ is sum of the remainder of each terms, modulo $7$.
So $a^2\equiv 1 \pmod{7}$ since $a=7k+6$ then $a^2=7l+1$; $\quad$
$3a\equiv 4 \pmod{7}$ since $3a=21k+18=21k+14+4$ and clearly $4\equiv 4 \pmod{7}$.
Finally $1+4+4 \equiv 2 \pmod{7}$ then the remainder is $2$.
