Does $\sum_{n=1}^{\infty} \pm \frac{1}{n} = 0$ have a predictable solution for $(\pm)$? 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.
 A: 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.
A: In general, since the series is not absolutely convergent, by suitably picking the signs you can obtain the result you desire. Here it is the proof.
Firstly over that for any $m$ the truncated sum
$$\sum_{n=m}^{\infty} \frac{1}{n} = \infty$$
Since the whole series is divergent. This means that no matter which threshold $L$ we fix, the series will be greater at some point. In other words, there exist $k$ such that
$$ (**) \ \ \ \ \sum_{n=m}^{k} \frac{1}{n} > L  $$
We will use this property repeatedly. Fix a limit $c \ge 0$ that you want to reach by properly adjusting the sign. Take the minimum $k_1$ such that
$$S_1 = \sum_{n=1}^{k_1} \frac{1}{n} \ge c$$
Analogously, there exist a minimum $k_2$ such that
$$ S_2 = S_1 + \sum_{n= k_1+1}^{k_2} - \frac{1}{n} \le c $$
By bouncing on and the off $c$ we get an $S_p$ that is closer and closer to it. Formally, note that  for example since $k_1$ is the minimum with the "going above $c$ " property
$$ S_1 - \frac{1}{k_1} < c \ \ \Rightarrow \ \ \ |S_1 - c | \le \frac{1}{k_1} $$
The same argument shows that
$$|  S_p - c | < \frac{1}{k_p}$$
So that
$$\lim_{p \to \infty} S_p = c$$
As you can see, this is a fairly general proof: it holds for all non absolutely convergent series with infinitesimal term.
