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.

A210725 Triangle read by rows: T(n,k) = number of forests of labeled rooted trees with n nodes and height at most k (n>=1, 0<=k<=n-1).

Original entry on oeis.org

1, 1, 3, 1, 10, 16, 1, 41, 101, 125, 1, 196, 756, 1176, 1296, 1, 1057, 6607, 12847, 16087, 16807, 1, 6322, 65794, 160504, 229384, 257104, 262144, 1, 41393, 733833, 2261289, 3687609, 4480569, 4742649, 4782969, 1, 293608, 9046648, 35464816, 66025360, 87238720, 96915520, 99637120, 100000000
Offset: 1

Views

Author

N. J. A. Sloane, May 09 2012

Keywords

Examples

			Triangle begins:
  1;
  1,    3;
  1,   10,   16;
  1,   41,  101,   125;
  1,  196,  756,  1176,  1296;
  1, 1057, 6607, 12847, 16087, 16807;
  ...
		

Crossrefs

Diagonals include A000248, A000949, A000950, A000951, A000272.

Programs

  • Maple
    f:= proc(k) f(k):= `if`(k<0, 1, exp(x*f(k-1))) end:
    T:= (n, k)-> coeff(series(f(k), x, n+1), x, n) *n!:
    seq(seq(T(n, k), k=0..n-1), n=1..9); # Alois P. Heinz, May 30 2012
    # second Maple program:
    T:= proc(n, h) option remember; `if`(min(n, h)=0, 1, add(
          binomial(n-1, j-1)*j*T(j-1, h-1)*T(n-j, h), j=1..n))
        end:
    seq(seq(T(n, k), k=0..n-1), n=1..10);  # Alois P. Heinz, Aug 21 2017
  • Mathematica
    f[?Negative] = 1; f[k] := Exp[x*f[k-1]]; t[n_, k_] := Coefficient[Series[f[k], {x, 0, n+1}], x, n]*n!; Table[Table[t[n, k], {k, 0, n-1}], {n, 1, 9}] // Flatten (* Jean-François Alcover, Oct 30 2013, after Maple *)
  • Python
    from sympy.core.cache import cacheit
    from sympy import binomial
    @cacheit
    def T(n, h): return 1 if min(n, h)==0 else sum([binomial(n - 1, j - 1)*j*T(j - 1, h - 1)*T(n - j, h) for j in range(1, n + 1)])
    for n in range(1, 11): print([T(n, k) for k in range(n)]) # Indranil Ghosh, Aug 21 2017, after second Maple code