8 Let $k>1$ be a given integer. We call a $k$-digit integer $a_{1} a_{2} \cdots a_{k}$ $p^{-}$ monotonic if for each integer $i$ satisfying $1 \leqslant i \leqslant k-1$, when $a_{i}$ is odd, $a_{i}>a_{i+1}$; and when $a_{i}$ is even, $a_{i}<a_{i+1}$. Find the number of $p-$ monotonic $k$-digit integers.
Let $m_{k}$ denote the number of $p^{-}$ monotonic $k$-digit integers. Then, when $k$ is even, $m_{k}=\frac{5^{k+2}-5^{k+1}-8}{12}$; and when $k$ is odd, $m_{k}=\frac{5^{k+2}-5^{k+1}+8}{12}$.

Under the given conditions, $a_{1} a_{2} \cdots a_{k}$ is $p$-monotonic if and only if for each integer $i$ satisfying $1 \leqslant i \leqslant k-1$, $a_{i}$ is either an odd number greater than $a_{i+1}$ or an even number less than $a_{i+1}$. It is not difficult to verify that for each fixed $a_{i+1}$, there are 5 choices for $a_{i}$ (for example, if $a_{i+1}=9$, then $a_{i} \in\{0,2,4,6,8\}$; if $a_{i+1}=8$ or 7, then $a_{i} \in\{0,2,4,6,9\}$, etc.).

If $a_{1}=0$, then $a_{2} \neq 0$, in which case we can obtain a $k-1$-digit $p$-monotonic number $a_{2} \cdots a_{k}$. Let $n_{k}$ denote the number of all $p$-monotonic numbers where $a_{1}$ can be 0. Since there are 10 choices for $a_{k}$ and 5 choices for each $a_{i}$ for $1 \leqslant i \leqslant k-1$, we have
$$
n_{k}=5^{k-1} \times 10=5^{k} \cdot 2.
$$

On the other hand, if $a_{1}=0$, then $a_{2} \neq 0$, and we can obtain a $k-1$-digit $p^{-}$ monotonic number $a_{2} \cdots a_{k}$, and vice versa. Therefore, we have
$$
m_{k}+m_{k-1}=n_{k}=5^{k} \cdot 2,
$$
for each integer $k$ greater than 1. Additionally, $m_{1}=9$ can be directly calculated. Let $m_{0}=1$, then (*) holds for any positive integer $k$.
If $k$ is an even number, let $k=2 k_{1}$. By (*), we have
$$
\begin{aligned}
\sum_{i=1}^{2 k_{1}} m_{i} & =\left(m_{2 k_{1}}+m_{2 k_{1}-1}\right)+\cdots+\left(m_{2}+m_{1}\right) \\
& =2\left(5^{2 k_{1}}+5^{2 k_{1}-2}+\cdots+5^{2}\right) \\
& =\frac{5^{2 k_{1}+2}-5^{2}}{12} \\
& =\frac{5^{k+2}-25}{12}.
\end{aligned}
$$

On the other hand, we also have
$$
\begin{aligned}
\sum_{i=1}^{2 k_{1}} m_{i} & =m_{2 k_{1}}+\left(m_{2 k_{1}-1}+m_{2 k_{1}-2}\right)+\cdots+\left(m_{3}+m_{2}\right)+m_{1} \\
& =m_{2 k_{1}}+2\left(5^{2 k_{1}-1}+5^{2 k_{1}-3}+\cdots+5^{3}\right)+9 \\
& =m_{2 k_{1}}+9+\frac{5^{2 k_{1}+1}-5^{3}}{12} \\
& =m_{2 k_{1}}+9+\frac{5^{k+1}-125}{12}.
\end{aligned}
$$

Combining the above two equations, we get
$$
\begin{aligned}
m_{k} & =m_{2 k_{1}}=\frac{5^{k+2}-25}{12}-\frac{5^{k+1}-125}{12}-9 \\
& =\frac{5^{k+2}-5^{k+1}-8}{12}.
\end{aligned}
$$

If $k$ is an odd number, then $k-1$ is an even number. Similarly, by (*), we have
$$
m_{k}=2 \cdot 5^{k}-\frac{5^{k+1}-5^{k}-8}{12}=\frac{5^{k+2}-5^{k+1}+8}{12}.
$$