So I'm wondering what is wrong with my reasoning.
Let $a_n$ be the number of strings of length $n$ in letters $A,B,C$ not containing substring $CC$.
I want to solve it like this. Let $b_n$ be the number of strings which end with $A$ or $B$ and $c_n$ be the number of strings that end with $C$.
For a string of length $n-1$ that ends with $A$ or $B$ there is three choices to append a symbol. For a string of same length but ends with $C$ there are two choices so we have $a_n=3b_{n-1}+2c_{n-1}$. Since $b_{n-1}+c_{n-1}=a_{n-1}$ and $b_{n-1}=a_{n-2}$ we have $a_n=3b_{n-1}+2c_{n-1}=a_{n-2}+2a_{n-1}$
I'm not sure but I think the correct solution is $a_n=2a_{n-2}+2a_{n-1}$. The answer is of no matter though, I would like to know what is wrong my reasoning.
Explanation of my reasoning. So first I try calculate $a_n$ from $b_{n-1}$ and $c_{n-1}$. I consider the strings of length $n-1$, they either end with $A$, $B$ or $C$. If they end with $A$ or $B$ then I have $3$ choices to append a symbol to the string so it becomes string of length $n$ thus there $3b_{n-1}$ strings where the second to last symbol is $A$ or $B$.
Further, consider the string of length $n-1$ where the last symbol is $C$. Then there are two choices append a symbol so there are $2c_{n-1}$ strings where the second to last symbol is C.
Then I add up the strings which the second to last symbol is $A$ or $B$ and $C$ and get $a_n=3b_{n-1}+2c_{n-1}$.