8. Among positive integers, the number of 2021-digit even numbers composed of $0$, $1$, $2$ (with each digit appearing at least once) is $\qquad$.

将上面的文本翻译成英文，请保留源文本的换行和格式，直接输出翻译结果。
$8.4 \times 3^{2019}-5 \times 2^{2019}+1$.
By the principle of inclusion-exclusion, the number of 2021-term sequences where 0, 1, and 2 each appear at least once is $3^{2021}-3 \times 2^{2021}+3$. Among these, the number of sequences starting with 0 is $3^{2020}-2 \times 2^{2020}+1$, the number of sequences ending with 1 is $3^{2020}-2 \times 2^{2020}+1$, and the number of sequences starting with 0 and ending with 1 is $3^{2019}-2^{2019}$. Therefore, the number of sequences that satisfy the conditions is
$$
\begin{array}{l}
3^{2021}-3 \times 2^{2021}+3-2 \times 3^{2020}+ \\
2 \times 2^{2021}-2 \times 1+3^{2019}-2^{2019} \\
=4 \times 3^{2019}-5 \times 2^{2019}+1 \text { (sequences) } .
\end{array}
$$