3. Arrange $1,2, \cdots, n(n>1)$ in a counterclockwise direction evenly on the circumference of a circle, and color these $n$ numbers using $r(r>1)$ colors, such that no three consecutive numbers on the circumference are all the same color. How many different coloring methods are there?
First, prove Lemma 1 (Example 2): Using $r (r > 1)$ colors to color $n$ numbers on a circle such that any two adjacent numbers have different colors, the number of methods is
$$
b_{n}=(r-1)^{n}+(-1)^{n}(r-1) \text {. }
$$

For the original problem, assume there are $k\left(1 \leqslant k \leqslant\left[\frac{n}{2}\right]\right)$ pairs of adjacent numbers with the same color. Then, by Lemma 1, the number of methods is $(r-1)^{n-k}+(-1)^{n-k}(r-1)$.

Next, prove Lemma 2: On a circle, $n$ numbers $1, 2, \cdots, n$ are arranged in sequence. Select $k$ numbers such that any two selected numbers are at least $s$ numbers apart ("distance $s$ " ordered $k$-tuples), the number of methods is
$$
c(n, k, s)=\frac{n}{k} \mathrm{C}_{n-k s-1}^{k-1} \text {. }
$$

Returning to the original problem: Among $n$ numbers on a circle, select $k$ pairs such that the first numbers of each pair form a $k$-combination with a distance of 1 $(s=1)$, and each pair of numbers is colored the same color.

By Lemma 2, the number of such $k$-combinations is $\frac{n}{k} \mathrm{C}_{n-k-1}^{k-1}$. Therefore, the number of coloring methods with $k$ pairs of adjacent numbers having the same color is $\frac{n}{k} \mathrm{C}_{n-k-1}^{k-1}\left((r-1)^{n-k}+(-1)^{n-k}(r-1)\right)$.
Note that, $1 \leqslant k \leqslant\left[\frac{n}{2}\right]$.
Thus, the total number of coloring methods with adjacent numbers having the same color is
$$
\sum_{k=1}^{\left[\frac{n}{2}\right]} \frac{n}{k} \mathrm{C}_{n-k-1}^{k-1}\left((r-1)^{n-k}+(-1)^{n-k}(r-1)\right) \text {. }
$$

Combining Lemma 1, the number of coloring methods without three consecutive numbers having the same color is
$$
\begin{array}{l}
(r-1)^{n}+(-1)^{n}(r-1)+ \\
\sum_{k=1}^{\left[\frac{n}{2}\right]} \frac{n}{k} \mathrm{C}_{n-k-1}^{k-1}\left((r-1)^{n-k}+(-1)^{n-k}(r-1)\right) .
\end{array}
$$