Today I tried to compute $$ \sum_{k =1}^{100}(-1)^k $$
Is there a way to find the result more quickly ?
Below if my attempt to find the result.
Especially without considering the case of odd and even numbers like I did ?
Let's consider the following sum:
$$ \sum_{k=1}^{n}(-1)^k = (-1)^1 + (-1)^2 + (-1)^3 + ... +(-1)^n $$
If $n$ is even then $\frac n2 $ terms have an even exponent and $\frac n2 $ terms have an odd exponent.
$$(-1)^p = -1 \tag{when $p$ is odd} $$ $$ (-1)^p = 1 \tag{when $p$ is even} $$
Then when $n$ is even
$$\begin{align} \sum_{k=1}^{n}(-1)^k &= \frac n2 \times(-1) + \frac n2 \times 1 \\ & = \frac n2 - \frac n2 \\ & = 0 \\ \end{align}$$
100 is an even number, so
$$ \sum_{k =1}^{100}(-1)^k = 0 $$