Let $a_n$ be the number of sequences of $n$ numbers, consisting of $0's, 1's$ and $2's$, such that a number $1$ on the $j$-th place isn't followed by a $1$ or $2$ on the $j+1$-th place for $1\leq j\leq n-1$.
I'm asked to prove that the correct recurrence relation for this sequence is given by $$a_n=2a_{n-1}+a_{n-2}, a_1=3,a_2=7$$
A shorter sequence can be extended in the following ways: let there be $x$ correct sequences with length $n$. Let's say $y$ sequences of length $n$ don't end with an $1$, that means you can extend those sequences with any of the three possibilities, giving $3y$ new sequences of length $n+1$. For the other $x-y$ sequences, ending in $1$, they can only be extended with a $0$, giving $x-y$ new sequences. The total number of new sequences now is $3y+x-y = 2y+x$. This seems going in the correct direction, I just don't see how they are linked to $a_{n-1}$ and $a_{n-2}$.
Let $S_n$ be the set of sequences constructed according to the rules. Then for $n > 2$ find a bijection
$$r_n \colon S_n \to S_{n-1}\times \{1,2\} \cup S_{n-2}$$
to prove the recurrence. To find the bijection, think of how a shorter sequence may be extended. Find the right end at which to extend the sequences.