Find a recursive formula for a string of the letters $A,B,C$ such that $AB, BC$ does not appear in.
$a_n=\begin {cases}A\text{____}a_{n-1}\\ B\text{____}a_{n-1}\\ C\text{____}a_{n-1}\\ -BC\text{____}a_{n-2}\\ -AB\text{____}a_{n-2}\\ -ABC\text{____}a_{n-3} \end{cases}$
So the sequence is $a_n=3a_{n-1}-2a_{n-2}-a_{n-3}$ and the starting conditions are trivial.
But I'm not sure about the $ABC$ part isn't it a double count since I already have the $AB, BC$?
Update: see below for a simpler derivation
Let $x_n$ be $n-$length allowed sequences, $a_n$ be the sequences ending on $A$, $b_n$ the sequences ending on $B$...
Then $$a_{n+1}=a_n+b_n +c_n \tag{1}$$ $$b_{n+1}=b_n +c_n\tag{2}$$ $$c_{n+1}=a_n +c_n\tag{3}$$
Replacing $(2)$ into $(1)$ we get rid of $b_n$:
$$ a_{n+2}-2a_{n+1} +a_n -c_{n+1}=0 \tag{4}$$
Together with $(3)$ this gives $$c_n = a_{n+2}-2a_{n+1} \tag{5}$$
Replacing this again in $(4)$ we get rid of $c_n$:
$$a_{n+3}=3a_{n+2}-2 a_{n+1}+a_n$$
Now, because $x_n=a_n+b_n+c_n=a_{n+1}$ this implies
$$ x_{n+1}=3 x_{n}-2x_{n-1}+x_{n-2}$$
Starting with $x_0=1$, $x_1=3$, $x_2=7$, this gives the sequence $1,3,7,16,37,86, 200 \cdots$
Update: a simpler derivation:
Let $x_n$ be the valid sequences of length $n$. Then $x_{n} = 3 x_{n-1} - y_{n}$ where $y_{n}$ are invalid sequences of length $n$, which are valid up to $n-1$. These correspond to such sequences ending on $AB$ (this count is $x_{n-2}$) plus such sequences ending on $BC$ (this count is $x_{n-2}-x_{n-3}$ - the last term accounts for the ending $ABC$ subsequence)
Then, $$x_n = 3 x_{n-1} - (x_{n-2} +x_{n-2} -x_{n-3})=3 x_{n-1} - 2 x_{n-2} +x_{n-3}$$