Example 11 Let $p(x)$ be a polynomial of degree $3n$, such that $P(0)=P(3) \cdots=P(3n)=2, P(1)=$ $P(4)=\cdots=P(3n-2)=1, P(2)=P(5)=\cdots=P(3n-1)=0, P(3n+1)=730$. Determine $n$.
(13th US Olympiad Problem)
Notice that as $x$ increases from 0 to $3n$ by 1, $P(x)-1$ cyclically takes the values $1,0,-1$. Mimicking this feature, consider the 3rd root of unity $\omega=-\frac{1}{2}+\frac{\sqrt{3}}{2} \mathrm{i}$. Note that for $n=0,1,2, \cdots$, the sequence $\left\{\omega^{n}\right\}=\{1, \omega, \omega^{2}, 1, \omega, \omega^{2}, \cdots\}$. Let $I_{m}\left(\omega^{n}\right)$ denote the coefficient of $\mathrm{i}$ in $\omega^{n}$, then
$$
\begin{array}{l}
\left\{2 I_{m}\left(\omega^{n}\right) / \sqrt{3}\right\}=\{0,1,-1,0,1,-1, \cdots\}, \\
\left\{2 I_{m}\left(\omega^{2 n+1}\right) / \sqrt{3}\right\}=\{1,0,-1,1,0,-1, \cdots\}.
\end{array}
$$

Therefore, for $x=0,1,2, \cdots, 3n$ we have
$$
P(x)-1=2 I_{m}\left(\omega^{2 x+1}\right) / \sqrt{3}.
$$

To obtain a polynomial in $x$, by the binomial theorem we have
$$
\omega^{2 x}=\left[1+\left(\omega^{2}-1\right)\right]^{x}=\sum_{k=0}^{x} C_{x}^{k}\left(\omega^{2}-1\right)^{k}.
$$

The right-hand side of (*) is $2 I_{m}\left[\omega \sum_{k=0}^{x} C_{x}^{k}\left(\omega^{2}-1\right)^{k}\right] / \sqrt{3}$. $C_{x}^{k}$ can be expanded as a $k$-degree polynomial in $x$, and when $x$ takes non-negative integers less than $k$, $C_{x}^{k}=0$. Since we need a $3n$-degree polynomial in $x$, and $x$ takes the values $0,1,2, \cdots, 3n$, we consider the polynomial: $Q(x)=2 I_{m}\left[\omega \sum_{k=0}^{3 n} C_{x}^{k}\left(\omega^{2}-1\right)^{k}\right] / \sqrt{3}$.

Clearly, $Q(x)$ is of degree $3n$, and when $x$ takes the $3n+1$ values $0,1,2, \cdots, 3n$, it is equal to (*). Therefore, we have the identity $P(x)-1 \not \equiv Q(x)$.
Thus, $P(3 n+1)-1=Q(3 n+1)$
$$
\begin{array}{l}
=2 I_{m}\left[\omega \sum_{k=0}^{3 n} C_{3 n+1}^{k}\left(\omega^{2}-1\right)^{k}\right] / \sqrt{3} \\
=2 I_{m}\left[\omega \sum_{k=0}^{3 n+1} C_{3 n+1}^{k}\left(\omega^{2}-1\right)-\omega C_{3 n+1}^{3 n+1}\left(\omega^{2}-1\right)^{3 n+1}\right] / \sqrt{3} \\
=2 I_{m}\left[\omega\left(1+\omega^{2}-1\right)^{3 n+1}-\omega\left(\omega^{2}-1\right)^{3 n+1}\right] / \sqrt{3} \\
=2 I_{m}\left[\omega^{6 n+3}-\omega(\mathrm{i} \omega \cdot \sqrt{3})^{3 n+1}\right] / \sqrt{3} \\
=-2 I_{m}\left[\mathrm{i} \omega^{2}(\mathrm{i} \sqrt{3})^{3 n}\right] \\
=\left\{\begin{array}{l}
(-1)^{k} \cdot 3^{3 k}, \text { when } n=2 k, \\
(-1)^{k} \cdot 3^{3 k+2}, \text { when } n=2 k+1.
\end{array}\right.
\end{array}
$$

Given that $P(3 n+1)-1=730^{\circ}-1=729$, i.e., $(-1)^{k} \cdot 3^{3 k}=3^{6}$, hence $k=2, n=4$.