>>12412084Here's a good way to look at the sum S.
Look at the series 1 + x + x^2 + x^3 + ...
For |x|<1, this series actually converges to the value
1/(1-x)
For example, 1+ (-1/2) + (-1/2)^2 + ... approaches 1/(1+1/2)=2/3.
Now if you make x closer and closer to 1, predictably the sum you get explodes to infinity.
Curiously, this does not happen when you let x approach -1 from the left. The closer and closer you let x approach -1, the closer the sum gets to 1/(1-(-1))=1/2.
Hence it makes sense to assign 1-1+1-1+1-1..... = 1 + (-1) + (-1)^2 + (-1)^3 + ... the value 1/(1-(-1))=1/2.