Example 2 Divide a circle into $n(n \geqslant 2)$ sectors, each sector is colored with one of $r$ different colors, and it is required that adjacent sectors are colored differently. Question: How many coloring methods are there?
Solution $\mathbf{1}^{[1]}$ Let the sectors of the circle be $S_{1}, S_{2}, \cdots, S_{n}$, and there are $a_{n}$ ways to color them. Then
$$
a_{1}=0, a_{2}=r(r-1) \text {. }
$$

When $n \geqslant 2$, $S_{1}$ has $r$ ways to be colored, $S_{2}$ has $r-1$ ways to be colored, $\cdots \cdots S_{n}$ has $r-1$ ways to be colored. There are a total of $r(r-1)^{n-1}$ methods, which can be divided into two categories:
(1) $S_{n}$ and $S_{1}$ have different colors, with $a_{n}$ methods.
(2) $S_{n}$ and $S_{1}$ have the same color, with $a_{n-1}$ methods.
Thus, $r(r-1)^{n-1}=a_{n}+a_{n-1}(n \geqslant 2)$.
Therefore, $a_{n}=(r-1)(-1)^{n}+(r-1)^{n}$.
Solution 2 Set $S_{1}, S_{2}, \cdots, S_{n}, a_{n}$ as in Solution 1, $a_{1}=0, a_{2}=r(r-1)$.

When $n \geqslant 3$, if $S_{n-1}$ and $S_{1}$ have the same color, then $S_{n}$ has $r-1$ ways to be colored, and $S_{1}$ to $S_{n-2}$ have $a_{n-2}$ ways to be colored. If $S_{n-1}$ and $S_{1}$ have different colors, then $S_{n}$ has $r-2$ ways to be colored, and $S_{1}$ to $S_{n-1}$ have $a_{n-1}$ ways to be colored.
Thus, $a_{n}=(r-2) a_{n-1}+(r-1) a_{n-2}$.
Therefore, $a_{n}=(r-1)(-1)^{n}+(r-1)^{n}$.