## Task 12/66

The sum

$$
s_{n}=1^{2}-2^{2}+3^{2}-4^{2}+\ldots+(-1)^{n-2}(n-1)^{2}+(-1)^{n-1} n^{2}
$$

is to be calculated!
1.) Let $n$ be an even number. Then,

$$
\begin{aligned}
& s_{n}=\left(1^{2}-2^{2}\right)+\left(3^{2}-4^{2}\right)+\ldots+\left[(n-1)^{2}-n^{2}\right]=-3-7-11-\ldots-(2 n-1)=-(3+7+11+\ldots+(2 n-1))= \\
&=-\frac{1}{2}\left[(3+(2 n-1)] \cdot \frac{n}{2}=-\frac{n(n+1)}{2}\right.
\end{aligned}
$$

2.) Let $n$ be an odd number. Then, $s_{n}=s_{n-1}+n^{2}$, where $n-1$ is an even number. We can apply the result from 1.) to $n-1$: $s_{n}=-\frac{(n-1) n}{2}+n^{2}=\frac{n(n+1)}{2}$.

Combining both results, we get

$$
s_{n}=(-1)^{n-1} \frac{n(n+1)}{2}
$$

Noting that on the right, except for the sign, it is the sum formula of natural numbers, we obtain the result in the form $1^{2}-2^{2}+3^{3}-4^{2}+\ldots \pm n^{2}= \pm(1+2+\ldots n)$.