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.
