OFFSET
1,1
COMMENTS
In contrast to A128754 and A128756 (which are generated analogously from the primes and the lucky numbers, respectively), this sequence seems consisting solely of fixed points and cycles of length 4,5 and 6. It is also notable that the difference of the number of fixed points and the number of cycles never differs by more than 3, up to index 10000, according to numerical tests. Thus the ratio of the number of fixed points to the number of cycles seems to be asymptotically equal to unity.
LINKS
PROG
(PARI) {vperm(z)=local(n, m, q, v, x, j, g);
/* Permutation of positive integers so that starting with the sequence of positive integers, sequentially swap the i-th term with max(i-g(i), 1)-th term, where g(i)=z[i+1]-z[i]-1. */
j=matsize(z)[2]-1; n=j-z[j]+z[j-6]; v=vector(j); x=vector(n); for(i=1, j, v[i]=i);
for(i=1, j, g=min(z[i+1]-z[i]-1, i-1); q=v[i]; v[i]=v[i-g]; v[i-g]=q); for(i=1, n, x[i]=v[i]); return(x)}
a=vperm(A000069)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ferenc Adorjan (fadorjan(AT)freemail.hu or ferencadorjan(AT)gmail.com), May 01 2007
STATUS
approved