The goal is the find the value of \(S\).
$$S=1+2+3+4+\dots$$
We were given the value of \(S_1\)
$$S_1=1-1+1-1+\dots=0.5$$
Notice
$$ \begin{align*} 1-1+1-1+1-1+\dots&=+0.5\\ -1+1-1+1-1+\dots&=-0.5\\ 1-1+1-1+\dots&=+0.5\\ +\quad\qquad\qquad-1+1-1+\dots&=-0.5\\ \end{align*} $$
Adding them up together, call the new sequence \(S_2\)
$$ \begin{align*} S_2&=1-2+3-4+\dots\\ &=0.5-0.5+0.5-0.5+\dots\\ &=S_1/2\\ \end{align*} $$
Notice the difference between \(S\) and \(S_2\).
$$ \begin{align*} S-S_2&=0+4+0+8+0+12+\dots\\ &=4S\qquad\text{(ignore the 0)} \end{align*} $$
Wrapping everything up
$$ \begin{align*} S-S_2&=4S\\ S&=-S_2/3 \end{align*} $$
Since we know \(S_2=1/4\)
$$S=1+2+3+4+\dots=-1/12$$