OFFSET
1,1
COMMENTS
Similarly to A128754, this sequence also shows the characteristics of an "infinite braid".
LINKS
PROG
(PARI) {vperm(z)=local(n, j, g); /* Permutation of positive integers: starting with the sequence of positive integers, for i = 1, 2, 3, ..., swap the i-th term with max(i-g(i), 1)-th term, where g(i) = z[i+1]-z[i]-1. */
j=length(z)-1; n=j-z[j]+z[j-6]; v=[1..j];
for(i=1, j, g=min(z[i+1]-z[i]-1, i-1); [v[i], v[i-g]]=[v[i-g], v[i]]);
return(v[1..n])}
a=vperm(A000959_upto(10^3))
CROSSREFS
KEYWORD
nonn
AUTHOR
Ferenc Adorjan (fadorjan(AT)freemail.hu or ferencadorjan(AT)gmail.com), Mar 24 2007
EXTENSIONS
Edited by M. F. Hasler, Jan 09 2020
STATUS
approved