For $n\in\mathbb{N^+}$ we'll denote $a_n$ as the number of strings of length $n$ over $\{1,2,3,4,5\}$ such that the sum of each 2 adjacent characters is not divisible by 3.
Find a recurrence relation of the sequence $a_n$. Then, find a closed form of $a_n$ for all $n\ge 1$
Hey everyone. So I understand that the sequences that are not allowed are $12, 15$ | $21 , 24$ | $33$ | $42,45$ | $51,54$ . So there is symmetry and the only case which is different is when the sequence starts with a 3. So I define $b_n$ as the number of eligible strings that start with a 3. Now I'm quite lost.. Would be happy to get your help. Thanks in advance :)
Let $b_n$ be the number of valid strings ending with $3$, and $c_n$ be the number of valid strings not ending with $3$.
Suppose you have a box of all the $b_n$ strings, and a box of all the $c_n$ strings. How do you make the $b_{n+1}$ strings ending with $3$, and how do you make the other $c_{n+1}$ strings?