This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A373452 #30 Feb 16 2025 08:34:06 %S A373452 1,1,2,6,16,64,252,1460,6256,39760,230056,1920152,12154416,113087888, %T A373452 916563592,10586707896,80444848064,898922718272,8634371968224, %U A373452 117894609062176,1160052513737280,16638593775310528,200744153681516384,3415784055462112160,38542918215425934624 %N A373452 Number of (binary) heaps of length n whose element set equals [k] (for some k <= n). %C A373452 These heaps may contain repeated elements. Their element sets are gap-free and contain 1 (if nonempty). %H A373452 Alois P. Heinz, <a href="/A373452/b373452.txt">Table of n, a(n) for n = 0..495</a> %H A373452 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Heap.html">Heap</a> %H A373452 Wikipedia, <a href="https://en.wikipedia.org/wiki/Binary_heap">Binary heap</a> %e A373452 a(0) = 1: the empty heap. %e A373452 a(1) = 1: 1. %e A373452 a(2) = 2: 11, 21. %e A373452 a(3) = 6: 111, 211, 212, 221, 312, 321. %e A373452 a(4) = 16: 1111, 2111, 2121, 2211, 2212, 2221, 3121, 3211, 3212, 3221, 3231, 3312, 3321, 4231, 4312, 4321. %e A373452 (The examples use max-heaps.) %p A373452 b:= proc(n, k) option remember; `if`(n=0, 1, %p A373452 (g-> (f-> add(b(f, j)*b(n-1-f, j), j=1..k) %p A373452 )(min(g-1, n-g/2)))(2^ilog2(n))) %p A373452 end: %p A373452 a:= n-> add(add(binomial(k, j)*(-1)^j*b(n, k-j), j=0..k), k=0..n): %p A373452 seq(a(n), n=0..24); %t A373452 b[n_, k_] := b[n, k] = If[n == 0, 1, Function[g, Function[f, Sum[b[f, j]*b[n - 1 - f, j], {j, 1, k}]][Min[g - 1, n - g/2]]][2^(Length@IntegerDigits[n, 2] - 1)]]; %t A373452 T[n_, k_] := Sum[Binomial[k, j]*(-1)^j*b[n, k - j], {j, 0, k}]; %t A373452 a[n_] := Sum[T[n, k], {k, 0, n}]; %t A373452 Table[a[n], {n, 0, 24}] (* _Jean-François Alcover_, Sep 24 2024, after _Alois P. Heinz_ *) %Y A373452 Row sums of A373451. %Y A373452 Cf. A000670, A056971 (distinct elements), A373450. %K A373452 nonn %O A373452 0,3 %A A373452 _Alois P. Heinz_, Jun 05 2024