login
A335041
Numbers whose binary representation encodes a (binary) min-heap on elements from the set {0,1} with root at the least significant bit.
4
0, 1, 2, 3, 4, 6, 7, 8, 10, 12, 14, 15, 16, 20, 24, 26, 28, 30, 31, 32, 36, 40, 44, 48, 52, 56, 58, 60, 62, 63, 64, 72, 80, 88, 90, 96, 100, 104, 108, 112, 116, 120, 122, 124, 126, 127, 128, 136, 144, 152, 154, 160, 168, 176, 184, 186, 192, 200, 208, 216, 218
OFFSET
1,3
COMMENTS
All odd terms are in A000225.
LINKS
Eric Weisstein's World of Mathematics, Heap
Wikipedia, Binary heap
MAPLE
q:= proc(n) local i, l; l:= convert(n, base, 2);
for i from 2 to nops(l) do
if l[i]<l[iquo(i, 2)] then return false fi
od; true
end:
a:= proc(n) option remember; local k: for k from 1+
`if`(n=1, -1, a(n-1)) while not q(k) do od; k
end:
seq(a(n), n=1..70);
CROSSREFS
Cf. A000225 (subsequence), A335039, A335040, A335042 (subsequence).
Sequence in context: A065609 A334274 A225620 * A335042 A257282 A336488
KEYWORD
nonn,base
AUTHOR
Alois P. Heinz, May 20 2020
STATUS
approved