This has been an issue, I haven't been able to solve it yet despite many attempts.
The problem is the following:
$ \forall n \in \mathbb{N}^*, \forall M \in \mathbb{N}, \exists K \in \mathbb{N} | \exists (\epsilon_i)_{0<i\leq K} \in (0,1)^K$ such as:
$$ M = \sum_{i=1}^K (-1)^{\epsilon_i}i^n $$
for the case $n=1$:
It comes naturally from the fact that the difference of two consecutive numbers is equal to $1$. We just have to sum it.
For the case $n=2$:
Again it's not that hard:
$$(n+1)^2-n^2 = 2n+1$$
$$(n+3)^2-(n+2)^2 = 2n+5$$
Combining this two formulae we get that with $4$ numbers we can reach $4$. With this we only need to show that we can reach $1,2$ or $3$ and we wil have done it. $1$ and $3$ are easy. For $2$, we look at $\frac{\mathbb{Z}}{4\mathbb{Z}}$ and we see easily that $1+2^2+3^2 = 2$ so $2$ is reachable. Hence the demonstration for $n=2$.
However I can't find the way to go from those intuitive steps to the general step. If it's a duplicate please let me know. This is a just for fun project, no general background nor context.
Thanks in advance.