TITLE: Reordering sequences
QUESTION [6 upvotes]: I am trying to study the reordering of sequences. I am having difficulties finding any learned articles, probably because I don't know the key words to search for. I hope if I can describe what I want to do someone can can expand my knowledge or name what I am doing so I can research it myself.
I want to define a reordering of a sequence in a form that can be coded easily. Here I will use $S(...)$.
I start with the most simple integer sequence.
$1,2,3,4,5,...$
Perhaps I want to swap pairs of them to become:
$2,1,4,3,6,5,... = S(3,-1)$ meaning skip forward 3, then skip back 1 and repeat.
or reverse triplets
$3,2,1,6,5,4,9,... = S(5,-1,-1)$ meaning skip forward 4, then skip back 1, and once more back 1 and repeat.
or something more complicated like
$5,4,2,3,1,10,9,7,8,6,15... = S(9,-1,-2,1,-2)$
so I define a function $S(...)$ that can do that which takes as parameters as the sequence of steps in the original sequence to make the new one (I haven't explained that very well but bear with me).
Now clearly I can code S without difficulty, I just need to retain enough history of the incoming sequence to jump back and forward as directed.
Is there a name for this function $S$ or something similar? Is there a way of examining the parameters of S to determine whether the resulting sequence:

emits all of the original sequence
does not emit duplicates

For example, $S(2,-1)$ would produce the sequence $2,1,3,2,4,3,...$ which is not acceptable because 2 gets repeated. And $S(2)$ would generate $2,4,6,8,...$ which skips some and is also not acceptable.
Is there a way of generating these orderings? There is clearly a null form $S(1)$ which could be considered the first.
Added
This process is manipulating an infinite sequence by applying $S$ repeatedly. The two requirements apply to the whole infinite sequence generated. So, for example $S(24,-23)$ is invalid because eventually a duplicate will arise even though the first iteration does not.

REPLY [2 votes]: Given $S(a_1,\ldots,a_n)$ we can determine if it generates all integers starting from $s$ by verifying $\displaystyle \sum_{k=1}^n a_k = n$ and that $\displaystyle f(i) = \sum_{k=1}^i a_k$ takes on every residue $\bmod n$ exactly once.
Effectively, $S(a_1,\ldots,a_n)$ is the first difference of $(f(0), f(1), \ldots,f(n))$. For example for $S(3, -1)$ we have $(0, 3, 2)$. In this format the first integer is always $0$ and the last integer is always $n$.
Now, to generate these, we first pick an $n$. Let's say $n = 5$. We then can choose an arbitrary permutation of the residues $\mod 5$, with the condition that the first element must be $0$ and then append $5$ as the last element:
$$(0,4,1,2,3,5)$$
Since only the residues must hold we can also add multiples of $n$:
$$(0,4,26,2,3,5)$$
Now if we delta encode this list, we have a valid $S$:
$$(0,4,26,2,3,5) \rightarrow S(4,22,-24,1,2)$$