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