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.

Showing 1-4 of 4 results.

A034855 Triangle read by rows giving number of rooted labeled trees with n >= 2 nodes and height d >= 1.

Original entry on oeis.org

2, 3, 6, 4, 36, 24, 5, 200, 300, 120, 6, 1170, 3360, 2520, 720, 7, 7392, 38850, 43680, 22680, 5040, 8, 50568, 475776, 757680, 551040, 221760, 40320, 9, 372528, 6231960, 13747104, 12836880, 7136640, 2358720, 362880, 10, 2936070, 87530400, 264181680
Offset: 2

Views

Author

Keywords

Examples

			2;
3,    6;
4,   36,    24;
5,  200,   300,   120;
6, 1170,  3360,  2520,   720;
7, 7392, 38850, 43680, 22680, 5040;
		

Crossrefs

Programs

  • Maple
    gf:= proc(k) gf(k):= `if`(k=0, x, x*exp(gf(k-1))) end:
    A:= proc(n, k) A(n, k):= n!*coeff(series(gf(k), x, n+1), x, n) end:
    T:= (n, d)-> A(n, d) -A(n, d-1):
    seq(seq(T(n, d), d=1..n-1), n=2..12);  # Alois P. Heinz, Sep 21 2012
  • Mathematica
    gf[k_] := gf[k] = If[k == 0, x, x*E^gf[k - 1]]; a[n_, k_] := n!*Coefficient[ Series[gf[k], {x, 0, n + 1}], x, n]; t[n_, d_] := a[n, d] - a[n, d - 1]; Table[t[n, d], {n, 2, 12}, {d, 1, n - 1}] // Flatten (* Jean-François Alcover, Jan 15 2013, translated from Alois P. Heinz's Maple program *)

Formula

Riordan reference gives recurrence.

Extensions

More terms from Pab Ter (pabrlos(AT)yahoo.com), May 27 2004

A001854 Total height of all rooted trees on n labeled nodes.

Original entry on oeis.org

0, 2, 15, 148, 1785, 26106, 449701, 8927192, 200847681, 5053782070, 140679853941, 4293235236324, 142553671807729, 5116962926162738, 197459475792232725, 8152354312656732976, 358585728464893234305, 16741214317684425260142, 826842457727306803110997, 43073414675338753123113980
Offset: 1

Views

Author

Keywords

Comments

Take any one of the n^(n-1) rooted trees on n labeled nodes, compute its height (maximal edge distance to root), sum over all trees.
Theorem [Renyi-Szekeres, (4,7)]. The average height if the tree is chosen at random is sqrt(2*n*Pi). - David desJardins, Jan 20 2017

References

  • Rényi, A., and G. Szekeres. "On the height of trees." Journal of the Australian Mathematical Society 7.04 (1967): 497-507. See (4.7).
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Also A234953(n) = a(n)/n.

Programs

  • Mathematica
    nn=20;a=NestList[ x Exp[#]&,x,nn];f[list_]:=Sum[list[[i]]*i,{i,1,Length[list]}];Drop[Map[f,Transpose[Table[Range[0,nn]!CoefficientList[Series[a[[i+1]]-a[[i]],{x,0,nn}],x],{i,1,nn-1}]]],1]  (* Geoffrey Critzer, Mar 14 2013 *)

Formula

a(n) = Sum_{k=1..n-1} A034855(n,k)*k. - Geoffrey Critzer, Mar 14 2013
A000435(n)/a(n) ~ 1/2 (see A000435 and the Renyi-Szekeres result mentioned in the Comments). - David desJardins, Jan 20 2017

Extensions

More terms from Geoffrey Critzer, Mar 14 2013

A234953 Normalized total height of all rooted trees on n labeled nodes.

Original entry on oeis.org

0, 1, 5, 37, 357, 4351, 64243, 1115899, 22316409, 505378207, 12789077631, 357769603027, 10965667062133, 365497351868767, 13163965052815515, 509522144541045811, 21093278144993719665, 930067462093579181119, 43518024090910884374263, 2153670733766937656155699
Offset: 1

Views

Author

N. J. A. Sloane, Jan 14 2014

Keywords

Comments

Equals A001854(n)/n. That is, similar to A001854, except here the root always has the fixed label 1.
This was in one of my thesis notebooks from 1964 (see the scans in A000435), but because it wasn't of central importance it was never added to the OEIS.

Crossrefs

Programs

  • Mathematica
    gf[k_] := gf[k] = If[k == 0, x, x*E^gf[k-1]]; a[n_, k_] := n!*Coefficient[Series[gf[k], {x, 0, n+1}], x, n]; a[n_] := Sum[k*(a[n, k] - a[n, k-1]), {k, 1, n-1}]/n; Array[a, 20] (* Jean-François Alcover, Mar 18 2014, after Alois P. Heinz *)
  • Python
    from sympy import binomial
    from sympy.core.cache import cacheit
    @cacheit
    def b(n, h): return 1 if min(n, h)==0 else sum([binomial(n - 1, j - 1)*j*b(j - 1, h - 1)*b(n - j, h) for j in range(1, n + 1)])
    def T(n, k): return b(n - 1, k - 1) - b(n - 1, k - 2)
    def a(n): return sum([k*T(n, k) for k in range(1, n)])
    print([a(n) for n in range(1, 31)]) # Indranil Ghosh, Aug 26 2017

Formula

a(n) = Sum_{k=1..n-1} k*A034855(n,k)/n = Sum_{k=1..n-1} k*A235595(n,k).

A235595 Triangle read by rows: the triangle in A034855, with the n-th row normalized by dividing it by n.

Original entry on oeis.org

1, 1, 2, 1, 9, 6, 1, 40, 60, 24, 1, 195, 560, 420, 120, 1, 1056, 5550, 6240, 3240, 720, 1, 6321, 59472, 94710, 68880, 27720, 5040, 1, 41392, 692440, 1527456, 1426320, 792960, 262080, 40320, 1, 293607, 8753040, 26418168, 30560544, 21213360, 9676800, 2721600, 362880, 1, 2237920, 119723130, 490458240, 691331760, 570810240, 323114400, 125798400, 30844800, 3628800
Offset: 2

Views

Author

N. J. A. Sloane, Jan 14 2014

Keywords

Comments

T(n,k) is the number of forests of labeled rooted trees with n nodes and height k Cf. A210725. Equivalently, T(n,k) is the number of nilpotent partial functions on [n] with index k+1. - Geoffrey Critzer, Nov 26 2021

Examples

			Triangle begins:
1.
1, 2,
1, 9, 6,
1, 40, 60, 24,
1, 195, 560, 420, 120,
1, 1056, 5550, 6240, 3240, 720,
1, 6321, 59472, 94710, 68880, 27720, 5040,
1, 41392, 692440, 1527456,1426320, 792960, 262080, 40320,
1, 293607, 8753040, 26418168, 30560544, 21213360, 9676800, 2721600, 362880,
...
		

Crossrefs

Programs

  • Maple
    b:= proc(n, h) option remember; `if`(min(n, h)=0, 1, add(
          binomial(n-1, j-1)*j*b(j-1, h-1)*b(n-j, h), j=1..n))
        end:
    T:= (n,k)-> b(n-1, k-1)-b(n-1, k-2):
    seq(seq(T(n, d), d=1..n-1), n=2..12);  # Alois P. Heinz, Aug 21 2017
  • Mathematica
    gf[k_] := gf[k] = If[k == 0, x, x*E^gf[k-1]]; a[n_, k_] := n!*Coefficient[Series[gf[k], {x, 0, n+1}], x, n]; t[n_, k_] := (a[n, k] - a[n, k-1])/n; Table[t[n, k], {n, 2, 11}, {k, 1, n-1}] // Flatten (* Jean-François Alcover, Mar 18 2014, after Alois P. Heinz *)
  • Python
    from sympy import binomial
    from sympy.core.cache import cacheit
    @cacheit
    def b(n, h): return 1 if min(n, h)==0 else sum([binomial(n - 1, j - 1)*j*b(j - 1, h - 1)*b(n - j, h) for j in range(1, n + 1)])
    def T(n, k): return b(n - 1, k - 1) - b(n - 1, k - 2)
    for n in range(2, 13): print([T(n, d) for d in  range(1, n)]) # Indranil Ghosh, Aug 26 2017, after Maple code

Formula

A234953(n) = Sum_{k=1..n} k*T(n,k).
Showing 1-4 of 4 results.