|
|
A353733
|
|
a(0)=0, a(1)=1; for k >= 1, a(2*k+1) and a(2*k+2) are the two smallest numbers not yet in the sequence whose binary expansions have no 1's in common with the binary expansion of a(k).
|
|
3
|
|
|
0, 1, 2, 4, 6, 5, 8, 3, 9, 16, 17, 10, 18, 7, 19, 12, 20, 22, 32, 11, 13, 14, 34, 21, 33, 36, 37, 24, 40, 44, 64, 35, 48, 41, 42, 65, 72, 15, 23, 52, 68, 50, 66, 49, 80, 25, 28, 74, 96, 26, 30, 27, 67, 82, 88, 38, 39, 69, 70, 81, 83, 29, 31, 76, 84, 71, 73, 86
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
This is a permutation of the nonnegative numbers (the proof is similar to that for A352808).
|
|
LINKS
|
|
|
EXAMPLE
|
For k=2, after a(2) = 2 = 10_2, we get a(5) = 5 = 101_2 and a(6) = 8 = 1000_2 since 101_2, 1000_2 have no 1's in common with 10_2.
|
|
PROG
|
(Python)
from itertools import count, islice
def agen(): # generator of terms
alst = [0, 1]; aset = {0, 1}; yield from alst
mink = 2
for n in count(2):
ahalf, k = alst[(n-1)//2], mink
while k in aset or k&ahalf: k += 1
alst.append(k); aset.add(k); yield k
while mink in aset: mink += 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|