# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a373608 Showing 1-1 of 1 %I A373608 #19 Jun 14 2024 11:11:06 %S A373608 1,1,1,3,7,23,92,502,1880,12008,66730,516610,3194229,29181056, %T A373608 224463264,2481941592,18805353654,203330533890,1845535279170, %U A373608 25328291231632,244141112078994,3361871786122320,39998248932957744,674899378544965360,7394457611253245344 %N A373608 Number of (binary) heaps of length n whose element set equals [k], where k is chosen so as to maximize this number. %C A373608 These heaps may contain repeated elements. Their element sets are gap-free and contain 1 (if nonempty). %H A373608 Alois P. Heinz, Table of n, a(n) for n = 0..495 %H A373608 Eric Weisstein's World of Mathematics, Heap %H A373608 Wikipedia, Binary heap %F A373608 a(n) = max({ A373451(n,k) : 0 <= k <= n }). %e A373608 a(4) = 7: 3121, 3211, 3212, 3221, 3231, 3312, 3321 (with k=3). %e A373608 a(6) = 92: 413112, 423111, 423112, 423113, 423121, 423122, 423123, ..., 443421, 444123, 444132, 444213, 444231, 444312, 444321 (with k=4). %e A373608 a(7) = 502: 5141123, 5141132, 5241113, 5241123, 5241131, 5241132, 5241133, ..., 5553421, 5554123, 5554132, 5554213, 5554231, 5554312, 5554321 (with k=5). %e A373608 (The examples use max-heaps.) %p A373608 b:= proc(n, k) option remember; `if`(n=0, 1, %p A373608 (g-> (f-> add(b(f, j)*b(n-1-f, j), j=1..k) %p A373608 )(min(g-1, n-g/2)))(2^ilog2(n))) %p A373608 end: %p A373608 T:= (n, k)-> add(binomial(k, j)*(-1)^j*b(n, k-j), j=0..k): %p A373608 a:= n-> max(seq(T(n, k), k=0..n)): %p A373608 seq(a(n), n=0..24); %Y A373608 Row maxima of A373451. %Y A373608 Cf. A002869. %K A373608 nonn %O A373608 0,4 %A A373608 _Alois P. Heinz_, Jun 10 2024 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE