Find polynomial congruent to function modulo 6 How to find polynomial with rational coefficients, which is congruent to given function (or prove that it doesn't exist)?  
Particularly, how to find $P(x)$, so
$$P(x)\equiv 4\left\lfloor\frac{x}{6}\right\rfloor\pmod{6}, x\in\mathbb{Z}$$?
I know that in some cases it's possible, for example, I have found:
$$\frac{2}{3}x(x-1)(x-2)\equiv 4\left\lfloor\frac{x}{3}\right\rfloor\pmod{6}, x\in\mathbb{Z}$$
I tried similar approach like in example, but polynomials like this don't work:
$$\text{const}\cdot x(x-1)(x-2)(x-3)(x-4)(x-5)$$
I also tried to create system of equations to find coefficients of polynomial with fixed degree. However, only some first values were congruent to given function.
 A: You could use the following identity to express $4\lfloor \frac{x}{6} \rfloor$ as a finite sum of cosine functions of x (that is equal to a sum of the real 6th roots of unity at integer values of x) which $P(x)$ would hence be required to be congruent to, I feel as if this may be helpful in that this is an expression that is a continuous function on R that you could then find a taylor series approximation to, the number of terms taken will of course effect how accurate the congruence relation will be when stated for such an approximation:
$$\Biggl\lfloor {\frac {p}{q}} \Biggr\rfloor ={\frac {p-\sum _{m=1}^{q-1}
   \left( q-m \right) \sum _{n=0}^{q-1}\frac{{{\rm e}^{{\frac {2\pi \,i \left( m+p \right) n}{q}}}}}{{q}}  }{q}}
$$
I understand that the actual function you will get itself is not an ideal choice in that it will be a big annoying sum of cosines, and is not a polynomial itself, but anyway in posting this answer I will probably have one of the more experienced people correct me or tell me why I am not being helpful, which will be a learning experience, hence worth the loss of reputation points, but really, it's not like they are a currency that mean anything in the real world anyway so, great deal when I think about it really!.
