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.)
Thank you for your time!