Example 10 Divide a circle into $n(n \geqslant 2)$ sectors, sequentially denoted as $s_{1}, s_{2}, \cdots, s_{n}$. Each sector can be painted with any of the three different colors: red, white, and blue, with the requirement that adjacent sectors must have different colors. How many ways are there to color the sectors?
(1989 Zhejiang Province Competition Question)
Let the total number of coloring methods be $a_{n}(n \geqslant 2)$, from the problem we get the recursive relation:
$a_{2}=6$, when $n \geqslant 3$, $a_{n}+a_{n-1}=3 \cdot 2^{n-1}$.
Let $f(x)=a_{2}+a_{3} x+a_{4} x^{2}+\cdots+a_{n} x^{n-2}+\cdots$
Then $x f(x)=a_{2} x+a_{3} x^{2}+\cdots+a_{n-1} x^{n-2}+\cdots$
And $-3 \cdot \frac{1}{1-2 x}=-3 \cdot 1-3 \cdot 2 x-3 \cdot 2^{2} x^{2}-\cdots-3 \cdot 2^{n} x^{n}-\cdots$
From $x \cdot f(x)+x^{2} \cdot f(x)-3 \cdot \frac{1}{1-2 x}=a_{2} x-3-6 x=-3$,
That is, $f(x)=\frac{6 x}{\left(x+x^{2}\right)(1-2 x)}=\frac{1}{x} \cdot\left(\frac{-2}{1+x}+\frac{2}{1-2 x}\right)$
$=\frac{1}{x}\left[-2 \sum_{k=0}^{\infty}(-1)^{k} x^{k}+2 \sum_{k=0}^{\infty} 2^{k} x^{k}\right]$
$=\frac{1}{x} \sum_{k=0}^{\infty}\left[-2 \cdot(-1)^{k}+2 \cdot 2^{k}\right] x^{k}=\sum_{k=0}^{\infty}\left[2(-1)^{k+1}+2^{k+1}\right] x^{k-1}$

Therefore, $a_{n}=2(-1)^{n}+2^{n}$ coloring methods (note that the coefficient of $x^{n-2}$ in $f(x)$ is $b_{n-2}=a_{n}$).