Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #13 Jun 06 2024 16:10:36
%S 1,1,5,55,1004,27456,1077657,59699950,3944644671,319905929418,
%T 32390662046661,4181039787994506,602128996908467070,
%U 102537208988632300118,20497804459093071390108,4978144718604701947160364,1232227300264551117529973052,335016989869301170468736520008
%N Number of (binary) heaps of length 2n whose element set equals [n].
%C These heaps contain repeated elements and their element sets are gap-free and contain 1 (if nonempty).
%H Alois P. Heinz, <a href="/A373500/b373500.txt">Table of n, a(n) for n = 0..254</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Heap.html">Heap</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Binary_heap">Binary heap</a>
%F a(n) = A373451(2n,n).
%e a(0) = 1: the empty heap.
%e a(1) = 1: 11.
%e a(2) = 5: 2111, 2121, 2211, 2212, 2221.
%e a(3) = 55: 312111, 312112, 313112, 321111, ..., 333221, 333231, 333312, 333321.
%e a(4) = 1004: 41311121, 41311211, 41311221, 41311231, ... 44444213, 44444231, 44444312, 44444321.
%e (The examples use max-heaps.)
%p b:= proc(n, k) option remember; `if`(n=0, 1,
%p (g-> (f-> add(b(f, j)*b(n-1-f, j), j=1..k)
%p )(min(g-1, n-g/2)))(2^ilog2(n)))
%p end:
%p a:= n-> add(binomial(n, j)*(-1)^j*b(2*n, n-j), j=0..n):
%p seq(a(n), n=0..17);
%Y Cf. A056971, A373451.
%K nonn
%O 0,3
%A _Alois P. Heinz_, Jun 06 2024