I found this problem in some internet olympiad-prep materials (don't remember the source of this file):
Find the number of $n$-element sequences $(a_1,a_2,\dots,a_n)$ such that $a_1=1$, $a_n=4$ and $a_i\in\{1,2,3,4\}$ and $|a_{i+1}-a_i|=1$ for all $i=1,\dots,n-1$.
Let $X_n$ be the number we want. Obvious values: $X_1=0$, $X_2=0$, $X_3=0$, generally $X_{2k-1}=0$ since we need to go from 1 to 4 and every step is $\pm 1$, so it changes the parity of our term. For the even $n$, I computed $X_4=1$ (as $(1,2,3,4)$ is the only one), $X_6=3$ (as $(1,2,1,2,3,4)$, $(1,2,3,2,3,4)$, $(1,2,3,4,3,4)$ are the only ones) and if I'm not mistaken $X_8=8$, $X_{10}=18$, $X_{12}=50$. Probably there is a recurrence relation between $X_{2k+2}$ and $X_{2k}$ or also previous terms, but I couldn't find it.
Disclaimer
This answer skips some details, but hopefully it's sufficient to guide you and let you research the details yourself.
The Answer
$$ x_{4+2m}= \left(\frac{5-3\sqrt{5}}{10}\right) \left(\frac{3-\sqrt{5}}{2}\right)^{m} + \left(\frac{5+3\sqrt{5}}{10}\right) \left(\frac{3+\sqrt{5}}{2}\right)^{m} $$
The Process
Define $y_{n}$ similar to $x_{n}$, except we have $a_{n}=2$. We have:
For a sequence to end with
Therefore, we obtain a recursion relation:
$$ \begin{pmatrix} x_{4+2m} \\ y_{4+2m} \end{pmatrix} = \begin{bmatrix} 1 & 1 \\ 1 & 2 \end{bmatrix} \begin{pmatrix} x_{4+2m-2} \\ y_{4+2m-2} \end{pmatrix} $$
or
$$ \begin{aligned} \begin{pmatrix} x_{4+2m} \\ y_{4+2m} \end{pmatrix} &= \begin{bmatrix} 1 & 1 \\ 1 & 2 \end{bmatrix}^{m} \begin{pmatrix} x_{4} \\ y_{4} \end{pmatrix}\\\\ &= \begin{bmatrix} 1 & 1 \\ 1 & 2 \end{bmatrix}^{m} \begin{pmatrix} 1 \\ 2 \end{pmatrix} \end{aligned} $$
Using the eigenvectors and eigenvalues of the square matrix, we obtain the explicit form of $x_{4+2m}$ above (and $y_{4+2m}$ but we don't need it).