<s>[INST] Prove that $3^n - 4(2^n) + (-1)^n + 6 \equiv 0 \mod 24 $ Is it possible to prove that $3^n - 4(2^n) + (-1)^n + 6 \equiv 0 \mod 24 $ for $n \geq 1 $ . I know that it is true because $ \frac{3^n - 4(2^n) + (-1)^n + 6}{24}$ represents the number of ways to uniquely $4$-colour an n-cycle , excluding permutations of colours.   
 [/INST] Let us try modulo $\pmod3,\pmod8$ separately.
As $4\equiv1\pmod3,2\equiv-1\implies2^n\equiv(-1)^n$
$$3^n-4\cdot2^n+(-1)^n+6\equiv-(-1)^n+(-1)^n\equiv0\pmod3$$
For $n\ge1,8\mid4\cdot2^n$
$$3^n-4\cdot2^n+(-1)^n+6\equiv3^n+(-1)^n+6\pmod8$$
Now as $3^2\equiv1\pmod8,(3^2)^m\equiv1$
If $n$ is even, $$3^n+(-1)^n+6\equiv9^m+1+6\pmod8\equiv1+1+6$$
What if $n$ is odd $=2m+1$
</s>