Context: The function $(-1)^n$ alternates between $1,-1$ because $n$ alternates between odd and even, I was trying to find a function $f(n)$ that will give $m$ positives then $m$ negatives and so on i.e the sequence $(-1)^{f(n)}$ will be $+1, +1, \dots(m \text{ times}), +1, -1,-1\dots(m \text{ times}),-1,\dots $ and I did find $\lfloor \frac{n-1}{m}\rfloor$ but I wonder what if we only allow $f$ to be a polynomial? Can we find such a polynomial for all $m$?
Let $f_m(x)$ be polynomial where $f_m(x)$ is odd for the first $m$ natural numbers and $f_m(x)$ is even for the second $m$ natural numbers and so on.
My question is: How to find $f_m \forall m \in \mathbb{N}$? if $f_m$ exist for $m$ then the solution is not unique but I want any solution
I found that $f_2(x)=\frac{x(x+1)}{2}$ which made me check for Faulhaber's polynomials and all of them are solution for $f_2$ (well it is easy to prove that). I couldn't find a solution for $f_3$ or any higher values of $m$. Maybe it is not possible to find such $f_m$ where $m$ is not in the form of $2^r$ but how to prove it?