How do I manipulate the sum of all natural numbers to make it converge to an arbitrary number?

I just found out that the Riemann Series Theorem lets us do the following: $$\sum_{i=1}^\infty{i}=-\frac{1}{12}$$But it also says (at least according to the wikipedia page on the subject) that a conditionally convergent sum can be manipulated to make it look like it converges into any real number. My question is then: Is there a general algorithm for manipulating this series into an arbitrary number?

My knowledge about series and number theory is pretty limited so if I'm in over my head or if the answer is just too complicated I'd appreciate some tips on what to read up on!

Thanks!


The theorem itself is proven by giving the algorithm. You can find a proof on Wikipedia: https://en.wikipedia.org/wiki/Riemann_series_theorem

However, the sum of the positive integers doesn't converge, no matter what order you put them in. The -1/12 result comes from a broader notion of summation than convergence, and is not connected to the Riemann rearrangement theorem.


There is such an algorithm, but first a quick note: $\sum_{i=1}^\infty i$ is not a conditionally convergent sequence. It is not convergent at all. It is equal to $-1/12$ in the sense of Ramanujan convergence, but that is not applicable to the Riemann series theorem.

Suppose that the series $$\sum_{i=1}^\infty a_n$$ of real numbers is conditionally convergent. Then there must be an infinite subsequence $\{a_{n_k}\}$ of positive terms of $\{a_n\}$ and an infinite subsequence $\{a_{m_k}\}$ of negative terms of $\{a_n\}$. The sequence $\{a_{n_k}\}$ must ahve a largest element, and $\{a_{m_k}\}$ must have a smallest element. Let's say you want to rearrange the series to add to some number $r$. Suppose that $r>0$. Start adding the terms of $\{a_{n_k}\}$ starting from the largest on down until the sum is bigger than $r$. Then add terms of $\{a_{m_k}\}$ starting from the smallest on up until the sum is smaller than $r$. Then add some more terms of $\{a_{n_k}\}$ until the sum is bigger again, and continue the process forever. Since the series is conditionally convergent, both series $$\sum_{k=1}^\infty a_{n_k}$$ and $$\sum_{k=1}^\infty a_{m_k}$$ are infinite, so you can always complete each step. In the limit, your sum will be $r$. If you want to add to some $r<0$, do the same thing, but start with the negative terms instead.