How many $6$ length strings above $\left\{1,2,3,4\right\}$ are there such that $24$ and $42$ aren't allowed.
The suitable recurrence relation for this problem is: $a_{n+2} = 2a_{n-1} + 4a{n-2}$. Hence, the characteristic polynomial is: $x^2 -2x -4 = 0$.It's roots are: $1+\sqrt5,1-\sqrt5$.
So, the genral function is: $\alpha (1+\sqrt5)^n + \beta (1-\sqrt5)^n$ We know that: $a_0=1$ and $a_1=4$. Hence,
$\beta = \frac{1}{2} - \frac{3}{2\sqrt5}$, $\alpha = \frac{1}{2} + \frac{3}{2\sqrt5}$
All in all,
$$(\frac{1}{2} + \frac{3}{2\sqrt5})(1+\sqrt5)^n + (\frac{1}{2} - \frac{3}{2\sqrt5})(1-\sqrt5)^n$$
Now, for $n=6$ the result is $1344$, but the book says $1216$.
Who's right?