A frog jumps from vertex to vertex of triangle $A B C$, moving each time to one of the adjacent vertices.

In how many ways can it get from $A$ to $A$ in $n$ jumps?
Let $a_{n}$ be the number of ways to return to the initial vertex in $n$ jumps, and $b_{n}$ be the number of ways to reach a neighboring vertex in $n$ jumps. It is easy to see that $a_{n+1}=2 b_{n}, b_{n+1}=a_{n}+b_{n}$. From this, it is not difficult to derive that $b_{n+2}=b_{n+1}+2 b_{n}, a_{n+2}=a_{n+1}+2 a_{n}$.

From the initial conditions $a_{0}=1, a_{1}=0$, we get $a_{n}=\frac{2^{n}+2 \cdot(-1)^{n}}{3}$ (this is not difficult to prove by induction).