A polynomial P(x) of degree 3n has the value 2 at x= 0, 3, 6,..., 3n, and:
the value 1 at x= 1, 4, 7, ... , 3n-2, and:
the value 0 at x= 2, 5, 8, ... , 3n-1.

Boy, was I wrong! For any n, the problem specifies 3n + 2 values, so not all n's will work. I "solved" the problem where the polynomial has the value 2 at x = 0, 3, 6, ... 3n - 3.