I have 5 characters ${a,b,c,1,2}$. $a_n$ is the number of strings I can create for $n$ length. I can't have the following sequences in a string: $a1$, $b2$ and any sequence of numbers $(12, 21)$.
For example legal string: $aaaa$, $abb1$, $1aaa$ For example illegal string: $aaa1$, $11cc$, $c121$
I need to find a Recurrence relation for $a_n$ and also seed values.
I thought about the following: if the string starts with 1, 2, $a$ or $b$, I have to decide for $n-2$ places which means $4*f(n-2)$. If it starts with any other character, then it's $f(n-1)$, all together $a_n = 4*f(n-2) + f(n-1)$. I'm not sure it is correct due.
Thanks