A129198 Slater-Velez permutation sequence of the 2nd kind.
1, 2, 5, 3, 11, 7, 23, 4, 47, 42, 95, 89, 191, 6, 383, 376, 767, 8, 1535, 1526, 3071, 9, 6143, 6133, 12287, 10, 24575, 24564, 49151, 49139, 98303, 12, 196607, 196594, 393215, 13, 786431, 786417, 1572863, 14, 3145727, 3145712, 6291455, 15, 12582911
Offset: 1
Keywords
Links
- P. J. Slater and W. Y. Velez, Permutations of the Positive Integers with Restrictions on the Sequence of Differences, Pacific J. Math., 71, 1977.
- William Y. Velez, Research problems 159-160, Discrete Math 110 (1992), pp. 301-302.
Programs
-
PARI
{SV_p2(n)=local(x,v=6,d=2,j,k,mx=2,nx=3,nd=2,u,w); /* Slater-Velez permutation - the 2nd kind */ x=vector(n);x[1]=1;x[2]=2; forstep(i=3,n,2,k=x[i]=2*mx+1;if(nd<=nx,j=x[i]-nd,j=nx);x[i+1]=j;mx=max(mx,max(j,k));v+=2^k+2^j; u=abs(k-x[i-1]);w=abs(j-k);d+=2^u+2^w;print(i" "k" "j" "u" "w); while(bittest(v,nx),nx++);while(bittest(d,nd),nd++)); return(x)}
Comments