Example 8 Let $R_{n}=\frac{1}{2}\left(a^{n}+b^{n}\right), a=3+2 \sqrt{2}, b=3-2 \sqrt{2}, n=1,2, \cdots$ What is the units digit of $R_{12345}$?
(41st AHSME Problem)
Given that $a$ and $b$ are the roots of the equation $x^{2}=6 x-1$, according to Newton's formula, we have
$$
R_{n+2}=6 R_{n+1}-R_{n} \text {. }
$$

It is easy to see that $R_{1}=\frac{1}{2}(a+b)=3, R_{2}=\frac{1}{2}\left(a^{2}+b^{2}\right)=17$. For convenience in writing, let $D_{n}$ represent the unit digit of $R_{n}$. By the pigeonhole principle, it is easy to know that $D_{1}, D_{2}, \cdots, D_{n}, \cdots$ is a periodic sequence. According to (*), it is easy to calculate
$$
D_{1}=3, D_{2}=7, D_{3}=9, D_{4}=7, D_{5}=3, D_{6}=1, D_{7}=3, D_{8}=7, D_{9}=9, D_{10}=
$$
$7, D_{11}=3, D_{12}=1, \cdots$ Therefore, the sequence $\left\{D_{n}\right\}$ has a period of 6, i.e., $D_{n+6}=D_{n}(n=1,2,3, \cdots)$. According to this, $D_{12345}=9$, which means the unit digit of $R_{12345}$ is 9.