We have a $M_n$ of all numbers that can be written as $1\pm2\pm3\pm...\pm n$. How many numbers will set contain if we can $\pm$ by $+$ or $-$. For example if $n$ is $3$ then we have $(1+2+3)=6$,$(1+2-3)=0$,$(1-2+3)=2$ and $(1-2-3)=-4$ so with $n=3$, $M_3$ contains $-4,0,2,6$.
In other words, if $M_n$ is the set of all numbers of the form $1\pm 2\cdots\pm n$, where each sign can be independently chosen to be either $+$ or $-$, then what is the size of $M_n$? By the above, $|M_3| = 4$.
Thanks for your answering.
For any integer $p \le q$, let
For any integer $n \ge 2$, let $N_n = \sum\limits_{k\in I(2,n)} k = \sum\limits_{k=2}^n k = \frac{n(n+1)}{2} - 1$.
For any $t = 1 \pm 2 \pm 3 \pm \cdots \pm n \in M_n$, let $A \subset I(p,q)$ be the collection of integer $k$ whose sign in the expansion of $t$ is positive. We have $$t = 1 + \sum_{k \in A} k - \sum_{k \in I(2,n) \setminus A} k = 1 - N_n + 2\sum_{k \in A} k$$ This establish a one-one correspondence between $M_n$ and $S(2,n)$. As a result, $$|M_n| = |S(2,n)|$$
It is easy to see $S(2,n) \subset I(0,N_n)$ and $0,2,N_n \in S(2,n)$ but $1,N_n - 1 \not\in S(2,n)$.
Now assume $n \ge 3$. For any $p \in S(2,n)$ such that $2 \le p < N_n - 2$, we can find a non-empty proper $A \subset I(2,n)$ such that $p = \sum\limits_{k \in A} k$. There are two possibilities:
$A$ doesn't have the form $I(q,n)$
In this case, $A$ contains an element $r$ such that $r+1 \in I(2,n)\setminus A$. Let $A' = ( A \setminus \{ r \} ) \cup \{ r + 1 \}$, we have: $A' \subset I(2,n)$ and $\sum\limits_{k \in A'} k = p + 1$. This implies $p + 1 \in S(2,n)$.
$A$ does have the form $I(q,n)$
In this case, $q > 3$ because $p < N_n - 2$. Let $A'' = ( A \setminus \{ q \} ) \cup \{ 2, q-1 \}$. Once again, we have $A'' \subset I(2,n)$ and $\sum\limits_{k \in A''} k = p + 1$. This implies $p + 1 \in S(2,n)$ again.
Combine these and notice $2 \in S(2,n)$, we find $S(2,n) = I(0,N_n) \setminus \{ 1, N_n - 1 \}$.
As a result, for $n \ge 3$, we have: $$|M_n| = |S(2,n)| = |I(0,N_n)| - 2 = N_n - 1 = \frac{n(n+1)}{2} - 2$$