<s>[INST] Find all n for which $2^n + 3^n$ is divisible by $7$? I am trying to do this with mods.  I know that:
$2^{3k+1} \equiv 1 \pmod 7$, $2^{3k+2} \equiv 4 \pmod 7$, $2^{3k} \equiv 6 \pmod 7$ and $3^{3k+1} \equiv 3 \pmod 7$, $3^{3k+2} \equiv 2 \pmod 7$,  $3^{3k} \equiv 6 \pmod 7$, so I thought that the answer would be when $n$ is a multiple of $3$ since then $2^{3k} + 3^{3k} \equiv 1 + 6 \pmod 7$, but it doesn't work for $n = 6$
 [/INST] Since $(x-2)(x-3)=x^2-5x+6$, we get that
$$
a_n=5a_{n-1}-6a_{n-2}
$$
is satisfied by $a_n=2^n+3^n$. Since $a_0\equiv2\pmod7$ and $a_1\equiv5\pmod7$, we get the following sequence mod $7$:
$$
\color{#C00}{2},\color{#C00}{5},6,\color{#090}{0},6,2,\color{#C00}{2},\color{#C00}{5},
$$
Thus, the sequence mod $7$ has period $6$. Therefore,
$$
n\equiv3\pmod6\iff2^n+3^n\equiv0\pmod7
$$
</s>