A129674 Permutation sequence generated by the "evil numbers" (A001969), by swapping n-th natural number by the (n-g)-th sequentially (iteratively), where g=min(evil(n+1)-evil(n)-1,n-1).
3, 2, 1, 6, 4, 7, 5, 10, 8, 12, 11, 13, 15, 14, 9, 18, 16, 20, 19, 21, 17, 24, 22, 25, 27, 26, 23, 30, 28, 31, 29, 34, 32, 36, 35, 37, 33, 40, 38, 41, 43, 42, 39, 46, 44, 48, 47, 49, 51, 50, 45, 54, 52, 55, 53, 58, 56, 60, 59, 61, 63, 62, 57, 66, 64, 68, 67, 69, 65, 72, 70, 73
Offset: 1
Links
Programs
-
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(A001969)
Comments