Example 6 As shown in Figure 2, let $A$ and $E$ be opposite vertices of a regular octagon. A frog starts jumping from vertex $A$. Except for vertex $E$, the frog can jump to any of the two adjacent vertices from any vertex of the octagon. When it jumps to vertex $E$, it stops there. Let the number of ways the frog can jump from vertex $A$ to $E$ in exactly $n$ jumps be $a_{n}$. Find $a_{n}$. [1]
Solution: Clearly,
$$
a_{1}=a_{2}=a_{3}=a_{2 m-1}=0\left(m \in \mathbf{N}_{+}\right), a_{4}=2 .
$$

Let the number of ways to jump from vertex $C$ to $E$ in $n$ steps be $b_{n}$. Then $b_{2}=1$.
For $a_{n}$, starting from vertex $A$ and jumping two steps can be divided into:
(1) Reaching point $C$ or $G$;
(2) Jumping from point $A$ to $B$ or $H$ and then returning to $A$.
Thus, $a_{n}=2 b_{n-2}+2 a_{n-2}$.
For $b_{n}$, starting from vertex $C$ and jumping two steps can also be divided into:
(1) Reaching point $A$;
(2) Jumping from point $C$ to $B$ or $D$ and then returning to $C$.
Thus, $b_{n}=a_{n-2}+2 b_{n-2}$.
Therefore, $a_{n}=4 a_{n-2}-2 a_{n-4}$ (for even $n$), and $a_{4}=2, a_{6}=8$.
Hence, $a_{2 m}=\frac{1}{\sqrt{2}}(2+\sqrt{2})^{m-1}-\frac{1}{\sqrt{2}}(2-\sqrt{2})^{m-1}$.