login
Sequence resulting from an infinite series of reordering steps applied to the sequence of natural numbers A000027: At step n number n is moved from its position p to position p+k, where k is the actual number at position p+1.
2

%I #19 Dec 21 2021 23:26:35

%S 1,3,2,4,5,8,6,7,9,12,13,10,11,16,14,17,18,15,20,24,19,25,21,22,23,31,

%T 26,34,27,33,28,37,29,38,36,30,39,32,35,46,44,47,40,48,41,42,43,49,50,

%U 53,45,58,51,59,61,52,67,54,68,55,69,56,70,57,60,73,62,63,64,65,66,80

%N Sequence resulting from an infinite series of reordering steps applied to the sequence of natural numbers A000027: At step n number n is moved from its position p to position p+k, where k is the actual number at position p+1.

%C This sequence is a permutation of the natural numbers.

%H Alois P. Heinz <a href="/A164287/b164287.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Angelini, <a href="http://www.cetteadressecomportecinquantesignes.com/ColourReadJump.htm">Colour, read and jump sequence</a>

%H E. Angelini, <a href="/A164286/a164286.pdf">Colour, drag and drop sequence</a> [Cached copy, with permission]

%H E. Angelini, <a href="/A164287/a164287.pdf">Color, read and jump sequence</a> [Cached copy, with permission]

%p mx:= 620: # increase mx to get more items

%p l:= [i$i=1..2*mx]: pos:= proc(n) global l; local i; for i to nops(l) while l[i]<>n do od; `if`(i>nops(l), -1, i) end: for n from 1 to mx do p:= pos(n); k:= l[p+1]; l:= [l[1..p-1][], l[p+1..p+k][], l[p], l[p+k+1..nops(l)][]] od: p:= pos(mx+1): a:= n-> `if`(n<p, l[n], NULL): seq(a(n), n=1..p);

%t max = 200; r = Range[max]; For[n = 1, True, n++, p = Position[r, n]; If[p == {} || (q = p[[1, 1]] + r[[p[[1, 1]] + 1]] + 1) > max, Break[], c = r[[q]]; r = r /. {a___, n, b___, c, d___} :> {a, b, n, c, d}]]; A164287 = r[[1 ;; 72]] (* _Jean-François Alcover_, Jun 14 2012 *)

%Y Cf. A164286.

%K nice,nonn,look

%O 1,2

%A _Eric Angelini_ and _Alois P. Heinz_, Aug 12 2009