TITLE: When alternate summing the first $n$ integers is $0$
QUESTION [6 upvotes]: For each integer $j$ in $1, \cdots, n$, choose a sign $f(j) = \pm 1$. Then, consider the value of the sum:
$$\sum_{j = 1}^n f(j)j = \pm 1 \pm 2 \pm \cdots \pm n$$
For some values of $n$, there is a choice of signs $f$ that makes this sum $0$, for example:
$$1 + 2 - 3 = 0$$
$$1 - 2 - 3 + 4 = 0$$
For other values of $n$, there isn't. Take $n \in \{1, 2, 5, 6\}$, for example. The question is:

For which values of $n$ there exists a choice of signs $f$ such as that $\sum f(j)j = 0$?


First of all, given four consecutive integers, we have:
$$n - (n+1) - (n+2) + (n+3) = 0$$
Thus, if there is such a choice for $n$, then it is also possible for any value $n' = n + 4k$, where $k \in \mathbb{N}$. As it can be done for $n = 3$ and $n = 4$, then it can only be impossible for integers congruent to $1$ or $2$ modulo $4$. I claimed that it is impossible for only finitely many values of $n$. My friend told me he figured out it was possible for every $n > 6$, but I haven't seen his solution yet. If it is possible for $n = 9$ and $n = 10$, we prove him correct - but I'm still working on it.

REPLY [2 votes]: Note that if the integers $j_1,j_2,...,j_k$ are the ones that are negative, then we have that the sum is equal to
$$\frac{n(n+1)}{2}-2(j_i,j_2,...,j_k)$$
and for this to be possible, $\frac{n(n+1)}{2}$ must be even and thus either $n$ or $n+1$ must be doubly even. When it is doubly even, you need only make a set of integers summing to $\frac{n(n+1)}{4}$ be negative. I'll leave the proof that there always exists such a set of integers up to you!
Nice problem!