# Equation that is equivalent to the summation presented?

The series that is represented is below the thick horizontal line. My question is: Is the equation

$$\sum_{i=1}^ni(-1)^{i-1}=-\left\lfloor\frac{n}2\right\rfloor+n(n\bmod 2)$$

correct for the series below?

$$1-2+3-4+5-6+7-8\ldots\pm(n-1)\mp n$$

(mod is for modulus, being remainder division. Didn't know if that was clear.)

Should I interpret $n(n \bmod 2)$ as $n$ if $n \equiv 1 \bmod 2$ and $0$ if $n \equiv 0 \bmod 2$? If so, then $n\left(n - 2\left\lfloor\frac{n}{2}\right\rfloor\right)$ gives the same result. –  Michael Albanese Oct 2 '12 at 2:28