I have a task that looks like this: "For what $n \geq 0$ is $2^n + 2 \times 3^n$ divisible by $8$?"
I have already solved this and gotten an answer, however there is one thing I can't prove in my solution and its bothering me.
I split up $2^n + 2 \times 3^n$ so that I got the terms separated. $2^n$ and $2\times 3^n$. When I studied what remainders $3^n \pmod 8$ gave I noticed that I got a pattern that goes $3,1,3,1,3,1,3,1..$ and so on. If $n$ was odd I get the remainder $3$ and if $n$ is even I get the remainder $1$.
According to Wolfram Alpha this pattern seems to go on forever. The question is why and how would I prove this? Does it have something to do with the fact that 3 is a prime number? I am quite new to this whole modulus thing...
This is quite general, and doesn't depend on $3$ being a prime number. Take any integer $k\ge 2$, and any integer $a$. Then the sequence $$a \bmod k,a^2 \bmod k,a^3 \bmod k,...$$ eventually settles down to a repeating sequence. This is easy to prove:
In your case, we have $3^2\equiv 3^0 \equiv 1\bmod 8$, so the sequence has just the two elements $3$ and $1$.
For a lot more on this topic, see any course on Elementary Number Theory.