P(x)P(x)P(x) is a polynomial of degree 3n3n3n 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 nnn.