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.
bob) so although similar it is not a complete match. There are also echoes of grey coding too. – OldCurmudgeon May 26 '17 at 14:16