Number of 10 digit numbers having digits 0,1,2 so that no two 0s are consecutive. Question : Find the number of 10 digit numbers having digits 0,1,2 so that no two 0s are consecutive. (here a number cannot begin with 0)
And here's my attempt : Let $b_n$ denote the number of such numbers with length $n$ and ending with $1,2$ (here the leading digit cannot be $0$) and $a_n$ the number of numbers ending with $0$.
Let $c_n=a_n+b_n$, we want to find $c_{10}$.
Note that $$a_n=b_{n-1}$$ since the second last digit of this thing should be a $1$ or a $2$. Also, $b_n=b_{n-1}+a_{n-1}=c_{n-1}$. It suffices to find $b_{11}$ but $b_n=b_{n-1}+b_{n-2}$ so it is easy to compute.
Note: I am not looking for the answer, just to check if my approach is correct and if better approaches exist
EDIT :  I guess this is a slightly less confusing way : denote by $a_n,b_n,c_n$ number of "numbers" of length $n$ ending with $0,1,2$ respectively, and $d_n=a_n+b_n+c_n$. Clearly, $b_n=c_n$ and $a_n=b_{n-1}+c_{n-1}=2b_{n-1}$. Further $b_n=c_n=a_{n-1}+b_{n-1}+c_{n-1}=d_{n-1}$. But $b_n=2b_{n-2}+2b_{n-1}$ which is easy to compute

The recurrence for $b_n$ is $b_n = 2 c_{n-1} = 2b_{n-1} + 2a_{n-1} = 2b_{n-1}+2b_{n-2}$ since given any number of length $n-1$ you can construct two numbers of length $n$ ending with $1$ or $2$.
