Find the number of sequences of length $m$ consisting of only digits, where each digit is in $\{0,1,2\}$ and such that $1$ is never followed immediately by $0$.
Attempt: I tried taking 10 as a block, but I got nowhere. I found the Mathematics question Number of permutations of thet set $\{1,2,...,n\}$ in which $k$ is never followed immediately by $k+1$.
Using that, since I need to remove only 1 followed by 0, I get only one set $A_1$ so, $3^m$ - 6 (3*2). Pick the other number in three ways, and we can permute 10 and other number in two ways). Is this right? I am from a non-math background; kindly consider this if possible.
HINT: Call such sequence good, and let $a_n$ be the number of good sequences of length $n$. If $\sigma$ is a good sequence of length $n$, we can form $3a_n$ sequences of length $n+1$ by appending a $0,1$, or $2$ to the end of $\sigma$. Every good sequence of length $n+1$ can be obtained in this way, but unfortunately so can some bad ones. The bad ones are those that end in $10$. These are clearly obtained by appending $01$ to a good sequence of length $n-1$, and there are $a_{n-1}$ of those, so our count of $3a_n$ includes exactly $a_{n-1}$ bad sequences, and we find that $a_{n+1}=3a_n-a_{n-1}$, or
$$a_n=3a_{n-1}-a_{n-2}\tag{1}$$
with initial values $a_0=1$ (because the empty sequence is good) and $a_1=3$.
Now use your favorite method to solve the recurrence $(1)$ to get a closed form for $a_n$.
A Shortcut: If you calculate the first few $a_n$, you get the following table:
$$\begin{array}{rcc} n:&0&1&2&3&4&5&6\\ a_n:&1&3&8&21&55&144&377 \end{array}$$
If you recognize the bottom row as a subsequence of some familiar sequence, you may be able to prove that it really is that subsequence and use that to get a closed form more easily.
Added: Since Jack D’Aurizio has now mentioned the Fibonacci numbers explicitly, I’ll elaborate on the shortcut bit. It’s quite well known (and easy to show) that the number of ways to tile a $1\times n$ strip using $1\times 1$ and $1\times 2$ tiles (monominoes and dominoes) is $F_{n+1}$. Thus, there are $F_{2n+2}$ ways to tile a strip of length $2n+1$. Number the cells of the strip $1$ through $2n+1$ from left to right, and suppose that we have a tiling of the strip by monominoes and dominoes. Label each even-numbered cell $L$ if it’s covered by the left half of a domino, $R$ if it’s covered by the right half of a domino, and $S$ if it’s covered by a monomino. There are $n$ even-numbered cells, so this labelling produces a string of length $n$ over the alphabet $\{L,R,S\}$. The only restriction on these strings is that they cannot contain the substring $LR$ (why?). Thus, there are $F_{2n+2}$ strings of length $n$ over the alphabet $\{L,R,S\}$ in which $L$ is never followed by $R$. Replace $L,R$, and $S$ by $1,0$, and $2$, respectively, to map these strings to the ones in the problem.