cp's OEIS Frontend

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.

A317012 Total number of elements in all permutations of [n], [n+1], ... that result in a binary search tree of height n.

This page as a plain text file.
%I A317012 #17 Jan 27 2021 10:14:43
%S A317012 0,1,10,1316,840124672,6110726696100443604557936,
%T A317012 439451426203104201222708341688051362423089952907263634936946272224
%N A317012 Total number of elements in all permutations of [n], [n+1], ... that result in a binary search tree of height n.
%C A317012 Empty external nodes are counted in determining the height of a search tree.
%H A317012 Alois P. Heinz, <a href="/A317012/b317012.txt">Table of n, a(n) for n = 0..9</a>
%H A317012 Wikipedia, <a href="https://en.wikipedia.org/wiki/Binary_search_tree">Binary search tree</a>
%H A317012 <a href="/index/Ro#rooted">Index entries for sequences related to rooted trees</a>
%H A317012 <a href="/index/Tra#trees">Index entries for sequences related to trees</a>
%F A317012 a(n) = Sum_{k=n..2^n-1} k * A195581(k,n) = Sum_{k=n..2^n-1} k * A244108(k,n).
%e A317012 a(2) = 10 = 2 + 3 + 3 + 2:
%e A317012 .
%e A317012          2           2           1
%e A317012         / \         / \         / \
%e A317012        1   o       1   3       o   2
%e A317012       / \         ( ) ( )         / \
%e A317012      o   o        o o o o        o   o
%e A317012       (2,1)   (2,1,3) (2,3,1)   (1,2)
%e A317012 .
%p A317012 b:= proc(n, k) option remember; `if`(n<2, `if`(k<n, 0, 1),
%p A317012       add(binomial(n-1, r)*b(r, k-1)*b(n-1-r, k-1), r=0..n-1))
%p A317012     end:
%p A317012 T:= (n, k)-> b(n, k)-b(n, k-1):
%p A317012 a:= k-> add(T(n, k)*n, n=k..2^k-1):
%p A317012 seq(a(n), n=0..6);
%t A317012 b[n_, k_] := b[n, k] = If[n < 2, If[k < n, 0, 1],
%t A317012   Sum[Binomial[n-1, r] b[r, k-1] b[n-1-r, k-1], {r, 0, n-1}]];
%t A317012 T[n_, k_] := b[n, k] - b[n, k-1];
%t A317012 a[k_] := Sum[T[n, k] n, {n, k, 2^k - 1}];
%t A317012 a /@ Range[0, 6] (* _Jean-François Alcover_, Jan 27 2021, after _Alois P. Heinz_ *)
%Y A317012 Cf. A195581, A227822, A244108, A335922.
%K A317012 nonn
%O A317012 0,3
%A A317012 _Alois P. Heinz_, Jul 18 2018