4. Let $S(n)$ denote the sum of the first $n$ terms of the series
$$
1-2+3-4+5-6+\cdots \text {. }
$$

For example, $S(5)=1-2+3-4+5=3$.
For what values of $a$ and $b$ does $S(a)+S(b)+S(a+b)=1$ ?
SolUTION
It is helpful to consider the terms of $S(n)$ in pairs from left to right, where we pair up the first and second terms, the third and fourth terms, etc.

Each pair is of the form $(i)-(i+1)=-1$ for some positive whole number $i$.
This observation allows us to find closed form expressions for $S(n)$.
If $n$ is even, every term will be part of a pair and $S(n)=(-1) \times\left(\frac{n}{2}\right)=\frac{-n}{2}$.
If $n$ is odd, every term but the final term will be part of a pair and $S(n)=(-1) \times\left(\frac{n-1}{2}\right)+n=\frac{n+1}{2}$.
To find the solutions to the equation $S(a)+S(b)+S(a+b)=1$, we will consider three separate cases:
(i) $a$ and $b$ both even.
If $a$ and $b$ are both even then so is $a+b$. This means that $S(a), S(b)$ and $S(a+b)$ are each negative and so cannot sum to one.
(ii) $a$ and $b$ both odd.
If $a$ and $b$ are both odd then $a+b$ is even. This means that,
$$
S(a)+S(b)+S(a+b)=\frac{a+1}{2}+\frac{b+1}{2}+\frac{-(a+b)}{2} .
$$

The right-hand side simplifies to 1 for all values of $a$ and $b$.
(iii) $a$ and $b$ have opposite parity.
If $a$ and $b$ have opposite parity then $a+b$ is odd. Without loss of generality we may assume that $a$ is odd and $b$ is even, which means that,
$$
S(a)+S(b)+S(a+b)=\frac{a+1}{2}+\frac{-b}{2}+\frac{a+b+1}{2} .
$$

The right-hand side simplifies to $a+1$ which can only be equal to one if $a=0$, but we know that $a$ is odd (and $a>0$ ).

The equation $S(a)+S(b)+S(a+b)=1$ is satisfied precisely when $a$ and $b$ are both odd numbers.