When you add up a series of numbers, it doesn’t matter in which order you add them—addition is commutative. But that only holds as long as the you’re adding a *finite* list of numbers. As is often the case, when infinity gets into the game, things get weird and counter-intuitive, and the order of summation can matter.

In 1833, Augustin-Louis Cauchy discovered that the alternating harmonic series

converges to different values depending upon the order in which the terms are summed. Bernhard Riemann investigated this matter and in 1868 proved that the terms of any conditionally convergent infinite series can be rearranged (permuted) to converge to any value at all, including positive or negative infinity: this is the Riemann rearrangement theorem (or series theorem).

The Lévy–Steinitz theorem extends this result to the complex numbers, proving that a conditionally converging series of complex numbers can be rearranged to either converge to any line in the complex plane or to the entire complex plane.