TITLE: Does $\sum_{n=1}^{\infty} \pm \frac{1}{n} = 0$ have a predictable solution for $(\pm)$?
QUESTION [6 upvotes]: I was wondering if:
$$ \sum_{n=1}^{\infty} \pm \frac{1}{n} = 0 $$
have a predictable solution for $(\pm)$.

I have checked this equation in Python implementing the algorithm:
$$ s_1 = 1 $$
$$ s_{m+1} = s_{m} + \frac{1}{m},\quad if \quad |s_{m} + \frac{1}{m}| < |s_{m} - \frac{1}{m}| $$
$$ s_{m+1} = s_{m} - \frac{1}{m},\quad if \quad |s_{m} - \frac{1}{m}| < |s_{m} + \frac{1}{m}| $$
and this sum tends to $0$ very accurately as $\frac{1}{m}$.



For this algorithm generated sequence of $+$ and $-$ seems to be random but it has some main rules, like there don't exist three times in a row the same operator: "$+++$" or "$---$".
Does there exist a function $f(m)$ which returns immediately $+$ and $-$ for any $m$ in correct order in respect to algorithm ?

Also I wonder if this equation have infinitely or finitely many solutions ?
Does this equation has a solution with pattern which could be easily demonstrated (I would love to see any) ?

Any words/articles/etc. that describes such considerations will be welcome, so I could google it.
I have no idea how to name such a problem.

REPLY [2 votes]: Your solution can be characterized more simply by choosing the sign of $\frac 1n$ to be opposite the sign of $s_{n-1}$.  Your solution does have three minus signs in a row.  It starts
$$\frac 11-\frac 12 - \frac 13 - \frac 14$$
That is the only time, as it is the only time the terms are decreasing so rapidly.    If $s_n \gt 0$ and the sign on $\frac 1n$ is $+$, we must have had $s_{n-1} \lt 0$, so $s_n \lt \frac 1n$.  Then the sign on $\frac 1{n+1}$ will be $-$.  If $s_{n+1} \gt 0$ the sign on $\frac 1{n+2}$ will also be $-$, but as $\frac 1{n+1}+\frac 1{n+2} \gt \frac 1n$ we must cross $0$ this time and the sign on $\frac 1{n+3}$ will be $+$ so we will not get three $-$ signs in a row.  The symmetric argument rules out three $+$ signs in a row.