A293977 Lexicographically smallest permutation of the nonnegative integers such that a(n) = a(2n) - a(2n-1) for all n >= 1.
0, 1, 2, 3, 5, 4, 7, 6, 11, 8, 12, 9, 16, 13, 19, 10, 21, 14, 22, 15, 27, 17, 26, 18, 34, 20, 33, 23, 42, 25, 35, 24, 45, 29, 43, 28, 50, 31, 46, 30, 57, 32, 49, 36, 62, 37, 55, 38, 72, 39, 59, 40, 73, 41, 64, 44, 86, 51, 76, 47, 82, 53, 77, 48, 93, 52, 81, 54, 97, 56, 84, 58
Offset: 0
Keywords
Links
- Carole Dubois, Table of n, a(n) for n = 0..1244
- E. Angelini, Successive weighing scales, post to the SeqFan list, June 14, 2010.
- E. Angelini, Weighing scales and sequences.
Programs
-
PARI
A293977_vec(n,A=vector(n+1),U=[0])={for(i=2,n,A[i]&&next;if(bittest(i,0),A[i]=A[i-1]+A[i\2+1],for(k=U[1]+1,oo,setsearch(U,k)&&next;setsearch(U,k+A[i\2+1])&&next; A[i]=k;break)); U=setunion(U,[A[i]]);while(#U>1&&U[2]==U[1]+1,U=U[^1]));A}
Comments