Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #13 Apr 23 2021 05:06:48
%S 0,0,1,6,48,360,2880,25200,262080,2903040,34473600,439084800,
%T 5987520000,87178291200,1351263513600,22230464256000,397533007872000,
%U 7469435990016000,147254595231744000,3041127510220800000,65688354220769280000,1481637322979573760000
%N Total number of distorted ancestor-successor pairs in all defective (binary) heaps on n elements.
%H Alois P. Heinz, <a href="/A324074/b324074.txt">Table of n, a(n) for n = 0..100</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) = Sum_{k=0..A061168(n)} k * A306393(n,k).
%p b:= proc(u, o) option remember; local n, g, l; n:= u+o;
%p if n=0 then 1
%p else g:= 2^ilog2(n); l:= min(g-1, n-g/2); expand(
%p add(x^(n-j)*add(binomial(j-1, i)*binomial(n-j, l-i)*
%p b(i, l-i)*b(j-1-i, n-l-j+i), i=0..min(j-1, l)), j=1..u)+
%p add(x^(j-1)*add(binomial(j-1, i)*binomial(n-j, l-i)*
%p b(l-i, i)*b(n-l-j+i, j-1-i), i=0..min(j-1, l)), j=1..o))
%p fi
%p end:
%p a:= n-> (p-> add(coeff(p, x, i)*i, i=0..degree(p)))(b(n, 0)):
%p seq(a(n), n=0..25);
%t b[u_, o_] := b[u, o] = Module[{n, g, l}, n = u + o; If[n == 0, 1,
%t g = 2^(Length[IntegerDigits[n, 2]]-1); l = Min[g-1, n-g/2]; Expand[
%t Sum[x^(n - j)*Sum[Binomial[j - 1, i]*Binomial[n - j, l - i]*
%t b[i, l-i]*b[j-1-i, n-l-j+i], {i, 0, Min[j - 1, l]}], {j, 1, u}] +
%t Sum[x^(j - 1)*Sum[Binomial[j - 1, i]*Binomial[n - j, l - i]*
%t b[l-i, i]*b[n-l-j+i, j-1-i], {i, 0, Min[j - 1, l]}], {j, 1,o}]]]];
%t a[n_] := With[{p=b[n, 0]}, CoefficientList[p, x].Range[0, Exponent[p, x]]];
%t a /@ Range[0, 25] (* _Jean-François Alcover_, Apr 23 2021, after _Alois P. Heinz_ *)
%Y Cf. A000523, A061168, A306393.
%K nonn
%O 0,4
%A _Alois P. Heinz_, Feb 14 2019