Closed form for $1-2+3-4+\cdots(-1)^{n-1}n$

138 Views Asked by At

How do I find a closed formula for the following?

$$\sum_{i=1}^n(-1)^{i-1}i$$

If $n$ is odd number, I can express it as $\frac{n+1}{2}$; if $n$ is even, then the expression if $\frac{-n}{2}$, but how do you find a expression that can express it in one formula?

3

There are 3 best solutions below

4
On BEST ANSWER

We can use $(-1)^n$ to distinguish positive and negative terms: $$ \frac{-n\cdot(-1)^n+\frac{1-(-1)^n}2}2=\frac{1 + (-1)^{n+1}(1+2n)}{4} $$

1
On

You can use the ceiling function: $(-1)^{n+1} \left\lceil \dfrac n2\right\rceil$.

For odd $n$, $\left\lceil \dfrac n2\right\rceil = \dfrac {n+1}2$ and $(-1)^{n+1} = 1$.

For even $n$, $\left\lceil \dfrac n2\right\rceil = \dfrac {n}2$ and $(-1)^{n+1} = -1$.

0
On

You can also solve the linear induction relation $S_n-S_{n-1}=(-1)^{n-1}n$

Homogeneous equation $H_n-H_{n-1}=0$ has solution $H_n=H_0$

A particular solution can be found of the form $(an+b)(-1)^{n-1}$ (since $-1$ is not root of homogeneous characteristic equation $x-1=0$, we can find a polynomial of same degree).

$(-1)^{n-1}n=(an+b)(-1)^{n-1}-(a(n-1)+b)(-1)^{n-2}=(-1)^{n-1}(an+b+an-a+b)$

$\iff a=\frac 12,\ b=\frac 14$

Therefore we get $S_n=H_0+(-1)^{n-1}(\frac 12n+\frac 14)$

Solving for $S_0=0=H_0-\frac 14$ we finally find back the formula given by Arthur, but via another resolution method: $$S_n=\frac 14+(-1)^{n-1}\left(\frac 12n+\frac 14\right)$$

Of course in this situation the closed formula can be guessed, but this theoretical method is more general and can be applied to more complicated sums. I think it's good to understand it on a simple problem too.