USAMO
1984
$P(x)$ is a polynomial of degree $3n$ such that
\begin{eqnarray*}
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, \quad\text{ and }\\
&& P(3n+1) = 730.\end{eqnarray*}
Determine $n$.