OFFSET
0,3
COMMENTS
Step from a(488) = 237 = 11101101_2 to a(489) = 749 = 1011101101_2 is the first case when one term is two binary digits longer than the previous. Considering the leading zeros, though, they still differ in only one bit. - Ivan Neretin, Jun 25 2015
LINKS
Paul Tek, Table of n, a(n) for n = 0..10000
FORMULA
From Alois P. Heinz, Feb 02 2023: (Start)
A101080(a(n),a(n+1)) = 1.
MAPLE
N:= 10: # to get all terms before the first where a(n) >= 2^N
B:= Array(0..2^N-1):
B[0]:= 1:
a[0]:= 0:
L:= Vector([0$N]):
for n from 1 do
cands:= select(t -> B[t[1]]=0, [seq(`if`(L[i]=0, [a[n-1]+2^(i-1), i], [a[n-1]-2^(i-1), i]), i=1..N)]);
if nops(cands)=0 then break fi;
j:= min[index](map(t->t[1], cands));
a[n]:= cands[j][1];
i:= cands[j][2];
B[a[n]]:= 1;
L[i]:= 1 - L[i];
od:
seq(a[i], i=0..n-1); # Robert Israel, Jun 25 2015
MATHEMATICA
Nest[Append[#, Min[Complement[BitXor[#[[-1]], 2^Range[0, Floor[Log2[#[[-1]]]] + 2]], #]]] &, {0, 1}, 71] (* Ivan Neretin, Jun 25 2015 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Keenan Pepper, Jul 23 2009
STATUS
approved