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-7 of 7 results.

A055277 Triangle T(n,k) of number of rooted trees with n nodes and k leaves, 1 <= k <= n.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 4, 3, 1, 0, 1, 6, 8, 4, 1, 0, 1, 9, 18, 14, 5, 1, 0, 1, 12, 35, 39, 21, 6, 1, 0, 1, 16, 62, 97, 72, 30, 7, 1, 0, 1, 20, 103, 212, 214, 120, 40, 8, 1, 0, 1, 25, 161, 429, 563, 416, 185, 52, 9, 1, 0, 1, 30, 241, 804, 1344, 1268, 732, 270, 65, 10, 1, 0
Offset: 1

Views

Author

Christian G. Bower, May 09 2000

Keywords

Comments

Harary denotes the g.f. as P(x, y) on page 33 "... , and let P(x,y) = Sum Sum P_{nm} x^ny^m where P_{nm} is the number of planted trees with n points and m endpoints, in which again the plant has not been counted either as a point or as an endpoint." - Michael Somos, Nov 02 2014

Examples

			From _Joerg Arndt_, Aug 18 2014: (Start)
Triangle starts:
01: 1
02: 1    0
03: 1    1    0
04: 1    2    1    0
05: 1    4    3    1    0
06: 1    6    8    4    1    0
07: 1    9   18   14    5    1    0
08: 1   12   35   39   21    6    1    0
09: 1   16   62   97   72   30    7    1    0
10: 1   20  103  212  214  120   40    8    1    0
11: 1   25  161  429  563  416  185   52    9    1    0
12: 1   30  241  804 1344 1268  732  270   65   10    1    0
13: 1   36  348 1427 2958 3499 2544 1203  378   80   11    1    0
...
The trees with n=5 nodes, as (preorder-) level sequences, together with their number of leaves, and an ASCII rendering, are:
:
:     1:  [ 0 1 2 3 4 ]   1
:  O--o--o--o--o
:
:     2:  [ 0 1 2 3 3 ]   2
:  O--o--o--o
:        .--o
:
:     3:  [ 0 1 2 3 2 ]   2
:  O--o--o--o
:     .--o
:
:     4:  [ 0 1 2 3 1 ]   2
:  O--o--o--o
:  .--o
:
:     5:  [ 0 1 2 2 2 ]   3
:  O--o--o
:     .--o
:     .--o
:
:     6:  [ 0 1 2 2 1 ]   3
:  O--o--o
:     .--o
:  .--o
:
:     7:  [ 0 1 2 1 2 ]   2
:  O--o--o
:  .--o--o
:
:     8:  [ 0 1 2 1 1 ]   3
:  O--o--o
:  .--o
:  .--o
:
:     9:  [ 0 1 1 1 1 ]   4
:  O--o
:  .--o
:  .--o
:  .--o
:
This gives [1, 4, 3, 1, 0], row n=5 of the triangle.
(End)
G.f. = x*(y + x*y + x^2*(y + y^2) + x^3*(y + 2*y^2 + y^3) + x^4*(y + 4*y^2 + 3*x^3 + y^4) + ...).
		

References

  • F. Harary, Recent results on graphical enumeration, pp. 29-36 of Graphs and Combinatorics (Washington, Jun 1973), Ed. by R. A. Bari and F. Harary. Lect. Notes Math., Vol. 406. Springer-Verlag, 1974.

Crossrefs

Programs

  • Mathematica
    rut[n_]:=rut[n]=If[n===1,{{}},Join@@Function[c,Union[Sort/@Tuples[rut/@c]]]/@IntegerPartitions[n-1]];
    Table[Length[Select[rut[n],Count[#,{},{-2}]===k&]],{n,13},{k,n}] (* Gus Wiseman, Mar 19 2018 *)
  • PARI
    {T(n, k) = my(A = O(x)); if(k<1 || k>n, 0, for(j=1, n, A = x*(y - 1  + exp( sum(i=1, j, 1/i * subst( subst( A + x * O(x^(j\i)), x, x^i), y, y^i) ) ))); polcoeff( polcoeff(A, n), k))}; /* Michael Somos, Aug 24 2015 */

Formula

G.f. satisfies A(x, y) = x*y + x*EULER(A(x, y)) - x. Shifts up under EULER transform.
G.f. satisfies A(x, y) = x*y - x + x * exp(Sum_{i>0} A(x^i, y^i) / i). [Harary, p. 34, equation (10)]. - Michael Somos, Nov 02 2014
Sum_k T(n, k) = A000081(n). - Michael Somos, Aug 24 2015

A301342 Regular triangle where T(n,k) is the number of rooted identity trees with n nodes and k leaves.

Original entry on oeis.org

1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 2, 0, 0, 0, 1, 4, 1, 0, 0, 0, 1, 6, 5, 0, 0, 0, 0, 1, 9, 13, 2, 0, 0, 0, 0, 1, 12, 28, 11, 0, 0, 0, 0, 0, 1, 16, 53, 40, 3, 0, 0, 0, 0, 0, 1, 20, 91, 109, 26, 0, 0, 0, 0, 0, 0, 1, 25, 146, 254, 116, 6, 0, 0, 0, 0, 0, 0, 1, 30, 223, 524, 387, 61, 0, 0, 0, 0, 0, 0, 0, 1, 36
Offset: 1

Views

Author

Gus Wiseman, Mar 19 2018

Keywords

Examples

			Triangle begins:
1
1   0
1   0   0
1   1   0   0
1   2   0   0   0
1   4   1   0   0   0
1   6   5   0   0   0   0
1   9  13   2   0   0   0   0
1  12  28  11   0   0   0   0   0
1  16  53  40   3   0   0   0   0   0
1  20  91 109  26   0   0   0   0   0   0
1  25 146 254 116   6   0   0   0   0   0   0
1  30 223 524 387  61   0   0   0   0   0   0   0
The T(6,2) = 4 rooted identity trees: (((o(o)))), ((o((o)))), (o(((o)))), ((o)((o))).
		

Crossrefs

Programs

  • Mathematica
    irut[n_]:=irut[n]=If[n===1,{{}},Join@@Function[c,Select[Union[Sort/@Tuples[irut/@c]],UnsameQ@@#&]]/@IntegerPartitions[n-1]];
    Table[Length[Select[irut[n],Count[#,{},{-2}]===k&]],{n,8},{k,n}]

A301345 Regular triangle where T(n,k) is the number of transitive rooted trees with n nodes and k leaves.

Original entry on oeis.org

1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 2, 1, 0, 0, 0, 1, 3, 1, 0, 0, 0, 1, 2, 4, 1, 0, 0, 0, 0, 3, 4, 5, 1, 0, 0, 0, 0, 2, 6, 6, 6, 1, 0, 0, 0, 0, 1, 6, 10, 9, 7, 1, 0, 0, 0, 0, 1, 5, 12, 16, 12, 8, 1, 0, 0, 0, 0, 0, 4, 13, 22, 23, 16, 9, 1, 0, 0, 0, 0, 0, 3, 14, 27, 36, 32, 20, 10, 1, 0, 0, 0, 0, 0, 2, 11
Offset: 1

Views

Author

Gus Wiseman, Mar 19 2018

Keywords

Examples

			Triangle begins:
1
1   0
0   1   0
0   1   1   0
0   0   2   1   0
0   0   1   3   1   0
0   0   1   2   4   1   0
0   0   0   3   4   5   1   0
0   0   0   2   6   6   6   1   0
0   0   0   1   6  10   9   7   1   0
0   0   0   1   5  12  16  12   8   1   0
The T(9,5) = 6 transitive rooted trees: (o(o)(oo(o))), (o((oo))(oo)), (oo(o)(o(o))), (o(o)(o)(oo)), (ooo(o)((o))), (oo(o)(o)(o)).
		

Crossrefs

Programs

  • Mathematica
    rut[n_]:=rut[n]=If[n===1,{{}},Join@@Function[c,Union[Sort/@Tuples[rut/@c]]]/@IntegerPartitions[n-1]];
    trat[n_]:=Select[rut[n],Complement[Union@@#,#]==={}&];
    Table[Length[Select[trat[n],Count[#,{},{-2}]===k&]],{n,15},{k,n}]

A301344 Regular triangle where T(n,k) is the number of semi-binary rooted trees with n nodes and k leaves.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 0, 0, 1, 4, 1, 0, 0, 1, 6, 4, 0, 0, 0, 1, 9, 11, 2, 0, 0, 0, 1, 12, 24, 9, 0, 0, 0, 0, 1, 16, 46, 32, 3, 0, 0, 0, 0, 1, 20, 80, 86, 20, 0, 0, 0, 0, 0, 1, 25, 130, 203, 86, 6, 0, 0, 0, 0, 0, 1, 30, 200, 423, 283, 46, 0, 0, 0, 0, 0, 0, 1, 36, 295, 816, 786, 234, 11, 0, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Mar 19 2018

Keywords

Comments

A rooted tree is semi-binary if all outdegrees are <= 2. The number of semi-binary trees with n nodes is equal to the number of binary trees with n+1 leaves; see A001190.

Examples

			Triangle begins:
1
1   0
1   1   0
1   2   0   0
1   4   1   0   0
1   6   4   0   0   0
1   9  11   2   0   0   0
1  12  24   9   0   0   0   0
1  16  46  32   3   0   0   0   0
1  20  80  86  20   0   0   0   0   0
1  25 130 203  86   6   0   0   0   0   0
The T(6,3) = 4 semi-binary rooted trees: ((o(oo))), (o((oo))), (o(o(o))), ((o)(oo)).
		

Crossrefs

Programs

  • Mathematica
    rbt[n_]:=rbt[n]=If[n===1,{{}},Join@@Function[c,Union[Sort/@Tuples[rbt/@c]]]/@Select[IntegerPartitions[n-1],Length[#]<=2&]];
    Table[Length[Select[rbt[n],Count[#,{},{-2}]===k&]],{n,15},{k,n}]

A214575 Triangle read by rows: T(n,k) is the number of partitions of n in which each part is divisible by the next and have first part equal to k (1 <= k <= n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 3, 2, 2, 1, 1, 1, 3, 2, 2, 1, 1, 1, 1, 4, 2, 4, 1, 2, 1, 1, 1, 4, 3, 4, 1, 3, 1, 1, 1, 1, 5, 3, 6, 2, 4, 1, 2, 1, 1, 1, 5, 3, 6, 2, 4, 1, 2, 1, 1, 1, 1, 6, 4, 9, 2, 7, 1, 4, 2, 2, 1, 1, 1, 6, 4, 9, 2, 7, 1, 4, 2, 2, 1, 1, 1, 1, 7, 4, 12, 2, 9, 2, 6, 2, 3, 1, 2, 1, 1
Offset: 1

Views

Author

Emeric Deutsch, Aug 18 2012

Keywords

Comments

T(n,k) is also the number of generalized Bethe trees with n edges and k leaves.
A generalized Bethe tree is a rooted tree in which vertices at the same level have the same degree; they are called uniform trees in the Goldberg and Livshits reference.
There is a simple bijection between generalized Bethe trees with n edges and partitions of n in which each part is divisible by the next (the parts are given by the number of edges at the successive levels). We have the correspondences: number of edges --- sum of parts; root degree --- last part; number of leaves --- first part; height --- number of parts.
Sum of entries in row n is A003238(n+1).
Apparently, Sum(k*T(n,k), k>=1) = A038046(n+1).

Examples

			T(7,4)=2 because we have (4,2,1) and (4,1,1,1).
Triangle starts:
  1;
  1, 1;
  1, 1, 1;
  1, 2, 1, 1;
  1, 2, 1, 1, 1;
  1, 3, 2, 2, 1, 1;
		

Crossrefs

An augmented version is A301343.

Programs

  • Maple
    with(numtheory): T := proc (n, k) if k = 1 then 1 elif n < k then 0 else add(T(n-k, divisors(k)[j]), j = 1 .. tau(k)) end if end proc: for n to 18 do seq(T(n, k), k = 1 .. n) end do; # yields sequence in triangular form

Formula

T(n,1)=1; T(n,k) = Sum_{j|k}T(n-k,j); T(n,k)=0 if k>n.

A301367 Regular triangle where T(n,k) is the number of orderless same-trees of weight n with k leaves.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 1, 1, 2, 1, 0, 0, 0, 1, 1, 1, 1, 2, 1, 3, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 3, 4, 4, 3, 5, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 1, 0, 0, 1, 2, 1, 1, 1, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 4, 5, 10, 11, 14, 12, 14, 7, 13, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Gus Wiseman, Mar 19 2018

Keywords

Comments

An orderless same-tree of weight n > 0 is either a single node of weight n, or a finite multiset of two or more orderless same-trees whose weights are all the same and sum to n.

Examples

			Triangle begins:
1
1   1
1   0   1
1   1   1   2
1   0   0   0   1
1   1   1   2   1   3
1   0   0   0   0   0   1
1   1   1   3   4   4   3   5
1   0   1   0   1   0   1   0   2
1   1   0   0   1   2   1   1   1   3
1   0   0   0   0   0   0   0   0   0   1
1   1   2   4   5  10  11  14  12  14   7  13
1   0   0   0   0   0   0   0   0   0   0   0   1
1   1   0   0   0   0   1   2   1   1   1   1   1   3
The T(8,5) = 4 orderless same-trees: (4((11)(11))), (4(1111)), ((22)(2(11))), (222(11)).
		

Crossrefs

Programs

  • Mathematica
    olstrees[n_]:=Prepend[Join@@Table[Select[Tuples[olstrees/@ptn],OrderedQ],{ptn,Select[IntegerPartitions[n],Length[#]>1&&SameQ@@#&]}],n];
    Table[Length[Select[olstrees[n],Count[#,_Integer,{-1}]===k&]],{n,14},{k,n}]
  • PARI
    S(g, k)={polcoef(exp(sum(i=1, k, x^i*subst(g, y, y^i)/i) + O(x*x^k)), k)}
    A(n)={my(v=vector(n)); for(n=1, n, v[n] = y + sumdiv(n, d, S(v[n/d], d))); apply(p -> Vecrev(p/y), v)}
    { my(v=A(16)); for(n=1, #v, print(v[n])) } \\ Andrew Howroyd, Aug 20 2018

A301366 Regular triangle where T(n,k) is the number of same-trees of weight n with k leaves.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 1, 2, 2, 1, 0, 0, 0, 1, 1, 1, 1, 5, 3, 3, 1, 0, 0, 0, 0, 0, 1, 1, 1, 2, 6, 12, 14, 12, 6, 1, 0, 1, 0, 3, 0, 3, 0, 2, 1, 1, 0, 0, 1, 7, 10, 10, 5, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 3, 7, 21, 41, 58, 100, 100, 94, 48, 20
Offset: 1

Views

Author

Gus Wiseman, Mar 19 2018

Keywords

Comments

A same-tree of weight n > 0 is either a single node of weight n, or a finite sequence of two or more same-trees whose weights are all the same and sum to n.

Examples

			Triangle begins:
1
1   1
1   0   1
1   1   2   2
1   0   0   0   1
1   1   1   5   3   3
1   0   0   0   0   0   1
1   1   2   6  12  14  12   6
1   0   1   0   3   0   3   0   2
1   1   0   0   1   7  10  10   5   3
1   0   0   0   0   0   0   0   0   0   1
1   1   3   7  21  41  58 100 100  94  48  20
The T(8,4) = 6 same-trees: (4(2(11))), (4((11)2)), ((22)(22)), ((2(11))4), (((11)2)4), (2222).
		

Crossrefs

Programs

  • Mathematica
    sametrees[n_]:=Prepend[Join@@Table[Tuples[sametrees/@ptn],{ptn,Select[IntegerPartitions[n],Length[#]>1&&SameQ@@#&]}],n];
    Table[Length[Select[sametrees[n],Count[#,_Integer,{-1}]===k&]],{n,12},{k,n}]
  • PARI
    A(n)={my(v=vector(n)); for(n=1, n, v[n] = x + sumdiv(n, d, v[n/d]^d)); apply(p -> Vecrev(p/x), v)}
    {my(v=A(16)); for(n=1, #v, print(v[n]))} \\ Andrew Howroyd, Aug 20 2018
Showing 1-7 of 7 results.