This post is a duplicate of this post.
The question is,
How many words of length $n$ is it possible to create from $\{a,b,c\}$ without any “$c$”s after a “$b$”?
For example, the string $\color{blue}{\text{aabac}}$ is allowed but $\color{blue}{\text{cc}\color{red}{\text{bc}}\text{ab}}$ is not allowed because it contains $\text{bc}$ in that order. It could, however include $\text{cb}$.
I worked it for small values of $n$, and searched the resulting sequence on OEIS.
I have been told of a method by forming a recurrence relation, which I have to still think upon, but the question is why is it related to even indexed fibonacci sequence? Is there any natural interpretation of this? I was amazed to see so many equivalent definitions of this problem in the OEIS page and this definition is one of them. I would be glad to see some different answers to this problem.
Here is another related post.
Let $a_n$ be the number of such strings of length $n$, $b_n$ be the number of such strings which end with
b, and $c_n$ the number of such strings which do not end withb. Thenbon the end, and this gives $a_n = a_{n-1}+c_n$band put anaon the end or you can take a string of length $n-1$ not ending inband put anaor acon the end, and this gives $c_n = a_{n-1}+c_{n-1}$$c_n = a_{n-1}+c_{n-1}$ and $a_n = a_{n-1}+c_n$ look Fibonacci-like. Suppose we define $d_n$ such that $d_{2n-1}=c_n$ and $d_{2n}=a_n$. Then we have $d_{2n-1}=d_{2n-2}+d_{2n-3}$ and $d_{2n}=d_{2n-1}+d_{2n-2}$ so combined $$d_{n}=d_{n-1}+d_{n-2}$$ which is the Fibonacci recurrence.
You also have to check the initial terms: $d_0=a_0=1$, $d_1=c_1=2$, $d_1=a_1=3$, so $d_n$ is the Fibonacci sequence offset by two positions, and $a_n=d_{2n}$ is the even terms of the Fibonacci sequence again with an offset.