TITLE: Rearrangements that never change the value of a sum
QUESTION [26 upvotes]: I posted this question on math.stackexchange.com and so far the only answer posted (also mentioned in the comments under the question) shows that one of my rash initial guesses about the bottom-line answer was wrong.
Which bijections $f:\{1,2,3,\ldots\}\to\{1,2,3,\ldots\}$ have the property that for every sequence $\{a_n\}_{n=1}^\infty$,
$$
\lim_{n\to\infty} \sum_{k=1}^n a_k = \lim_{n\to\infty} \sum_{k=1}^n a_{f(k)},
$$
where "$=$" is construed as meaning that if either limit exists then so does the other and in that case then they are equal?
Here's another rash initial guess, different from the one I posted on stackexchange: It's the bijections whose every orbit is finite.
(That there are uncountably many such bijections can be seen as follows: For each odd number $n$, let $f$ either fix $n$ and $n+1$ or interchange them.  That bijection never changes the values of sums.  It's a countably infinite sequence of binary choices, so it's uncountable.)

REPLY [19 votes]: For the purpose of recording an answer rather than just a pile of links: Michael Hardy requires that

if either limit exists then so does the other and in that case then they are equal?

Let's call this set $G$.
Levi answered a slightly different question, namely characterizing the permutations for which

if the left hand limit exists then so does the right and in that case then they are equal?

I'll call that $P$. Clearly, $G = P \cap P^{-1}$.
Theorem A permutation $f$ is in $P$ if and only if there is a constant $M$ such that, for any $N$, the set $f([1,N])$ can be written as $\bigcup_{i=1}^M [a_i, b_i]$, where $[a,b] = \{ a,a+1, \ldots, b \}$.
Levi provided a different characterization than this one; Agnew provided this characterization; I learned about both from Schaefer who points out that they are fairly directly equivalent.
Pleasants shows that $P$ is not closed under inversion. I haven't (in an one hour skim) found any papers which give a simpler characterization of $P \cap P^{-1}$ than the defining formula.
Remark I would find it nicer to restate Levi/Agnew's characterization as follows: For $S \subseteq \mathbb{N}$, define the blockiness of $S$ to be the least integer $\beta(S)$ such that $S$ can be written as $\bigcup_{i=1}^{\beta(S)} [a_i, b_i]$. (We could have $\beta(S) = \infty$.) Then $f$ is in $P$ if and only if there is a constant $M$ such that $\beta(f(S)) \leq M \beta(S)$. This makes it more obvious that $P$ is closed under composition.