proposed
approved
proposed
approved
editing
proposed
b[n_, t_] := b[n, t] = If[n == 0, 1, Function[g, Function [f,
Expand[b[f, t]*b[n-1-f, t]*x^t + b[f, t+1]*b[n-1-f, t+1]]][
Min[g-1, n-g/2]]][2^(Length@IntegerDigits[n, 2]-1)]];
a[n_] := Coefficient[b[n, 0], x, n];
Table[a[n], {n, 0, 37}] (* Jean-François Alcover, May 09 2024, after Alois P. Heinz *)
approved
editing
Alois P. Heinz, <a href="/A372641/b372641_1.txt">Table of n, a(n) for n = 0..2000</a>
editing
approved
Alois P. Heinz, <a href="/A372641/b372641_1.txt">Table of n, a(n) for n = 0..2000</a>
b:= proc(n, t) option remember; `if`(n=0, 1, (g-> (f->
expand(b(f, t)*b(n-1-f, t)*x^t+b(f, t+1)*b(n-1-f, t+1)
))(min(g-1, n-g/2)))(2^ilog2(n)))
end:
a:= n-> coeff(b(n, 0), x, n):
seq(a(n), n=0..37);
Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Heap.html">Heap</a>
Wikipedia, <a href="https://en.wikipedia.org/wiki/Binary_heap">Binary heap</a>
(The examples use max-heaps.)
Number of defective (binary) heaps on n, elements from the set {0,1} where exactly n ancestor-successor pairs do not have the correct order.