Let $d$ be an integer larger than $1$. If $f$ is a function from $\mathbb Z_{>0}$ into $\mathbb Z$, we denote $\bar{f}$ its quotient modulo $d$, that is $\bar{f}(n)=f(n)$ (mod $d$) for every $n\ge 1$.
If $\{s_n\}_{n \ge 1}$ is a $T$-periodic sequence in $\mathbb Z/{d\mathbb Z}$, does it exists a polynomial function $P$ with integer coefficients such that $\bar{P}(n)=s_n$ for every $n\ge 1$
For example, if $a_n$ is the sequence $0,1,0,1,0,...$, the $P(n)=n+1$ is suitable.
I have no idea where to start.
Edit (context): I was helping a student to expand a power series and it turned out that the series was of the form $a_0+a_1x-a_2x^2-a_3x^3+a_4x^4+a_5x^5+...$ (alternately two + signs and two - signs).
We tried to write it using $\Sigma$ notation and I looked at expressions of the form $(-1)^{P(n)}$ where $P$ is a polynomial. Finally, I thought about $\lfloor n/2 \rfloor$, but it made me wonder about the question above.
If $f\in \Bbb Z[X]$ is a polynomial, then $f(2)\equiv f(0)\pmod 2$. We conclude that the 4-periodic sequence $0,0,1,0$ is not represented by such a polynomial modulo $4$.