Interesting $\sum_{i=0}^{m-1}(-1)^{i}(m-i)^{2} = \sum_{i=1}^{m}i$

74 Views Asked by At

I found that for m $\in N $ $$\sum_{i=0}^{m-1}(-1)^{i}(m-i)^{2} = \sum_{i=1}^{m}i.$$ I found it after doing an exercise. For example: $$5^{2}-4^{2}+3^{2}-2^{2}+1^{2} = 1 + 2 + 3 + 4 + 5 = 15.$$ For me is the first time I saw this formula. I think it is a very nice formula and somehow "estetically symmetric". Have you ever encountered something like this?

1

There are 1 best solutions below

4
On

The proof is not that hard. Assume WLOG that $m$ is odd. Then

$$\begin{align}\sum_{i=0}^{m-1} (-1)^i (m-i)^2 &= \sum_{i=1}^m (-1)^{i+1} i^2 \\ &= 1^2-2^2+3^3-4^2 +\cdots+m^2\\&= 1^2+2^2+3^3+4^2 +\cdots+m^2-2 (2^2+4^2+\cdots(m-1)^2)\\&=\frac16 m (m+1)(2 m+1) - 2 \cdot 2^2 \frac16 \left (\frac{m-1}{2} \right )\left (\frac{m+1}{2} \right ) m\\ &= \frac16 m (m+1) [(2 m+1) - (2 m-2)] \\ &= \frac12 m (m+1)\end{align} $$

So, your observation holds. When $m$ is even, the sign is negative but the result is the same.