OFFSET
1,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Heap
Wikipedia, Binary heap
Wikipedia, Most significant bit
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
KEYWORD
nonn,base
AUTHOR
Alois P. Heinz, May 20 2020
STATUS
approved