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$

$2^{3}\equiv 8\equiv \color{red}1 \bmod 7$, which is why you get a cycle length of  $3$ for powers of $2 \bmod 7$. The cycle only closes when you reach $a^k\equiv 1$.
However $3^3=27\equiv 6 \bmod 7$ means that the exponential cycle length for $3\bmod 7$ is more than $3$. Fermat's little theorem says that every cycle length$\bmod 7$ (of numbers coprime to $7$) must divide $6$, so the cycle length for $3$ must be $6$.  (and indeed $3^6 \equiv (3^3)^2\equiv 6^2 \equiv 36 \equiv 1 \bmod 7$).
