Prove that for all $n \in \mathbb{N}$, either 3 or 13 divides $3^n + 13n^2 + 38$ Let $a\in \{3,13\}.$ I'm having trouble with this proof. I know that
$$3^{n+1} + 13(n+1)^2 + 38 = (3^n + 13n^2 + 38) + (2\cdot 3^n + 26n + 13)$$
But I can't prove that $a \mid 2\cdot3^n + 26n + 13$. I know that 13 doesn't divide this because $13 \nmid 2\cdot3^n$. How can I prove that $3 \mid 26n + 13$?

If $n\equiv1$ or $2\pmod3$ then $3^n+13n^2+38\equiv n^2+2\equiv0 \pmod 3$
because $3^n\equiv0$ and $13\equiv1$ and $38\equiv2 \pmod 3$, so $3|3^n+13n^2+38$.
If $n\equiv0\pmod3$ then $3^n+13n^2+38\equiv 1+12\equiv0\pmod { 13}$
because $3^3=27\equiv1 $ and $13\equiv0$ and $38\equiv12 \pmod {13}$, so $13|3^n+13n^2+38$.
