Problem: For each positive integer $n$, find the number of $n$-digit positive integers
for which no two consecutive digits are equal, and the last digit is a prime.

Solution: Almost trivial.
Let $a_n$ be the desired answer.
We have \[ a_n + a_{n-1} = 4 \cdot 9^{n-1} \]
for all $n$, by padding the $(n-1)$ digit numbers with a leading zero.

Since $a_0 = 0$, $a_1 = 4$, solving the recursion gives
\[ a_n = \frac 25 \left( 9^n - (-1)^n \right). \]
The end.

\begin{remark*}
  For concreteness, the first few terms are $0$, $4$, $32$, $292$, \dots.
\end{remark*}