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-10 of 11 results. Next

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

A301462 Number of enriched r-trees of size n.

Original entry on oeis.org

1, 2, 3, 8, 23, 77, 254, 921, 3249, 12133, 44937, 172329, 654895, 2565963, 9956885, 39536964, 156047622, 626262315, 2499486155, 10129445626, 40810378668, 166475139700, 676304156461, 2775117950448, 11342074888693, 46785595997544, 192244951610575, 796245213910406
Offset: 0

Views

Author

Gus Wiseman, Mar 21 2018

Keywords

Comments

An enriched r-tree of size n > 0 is either a single node of size n, or a finite sequence of enriched r-trees with weakly decreasing sizes summing to n - 1.
These are different from the R-trees of data science and the enriched R-trees of Bousquet-Mélou and Courtiel.

Examples

			The a(3) = 8 enriched r-trees: 3, (2), ((1)), ((())), (11), (1()), (()1), (()()).
		

Crossrefs

Programs

  • Mathematica
    ert[n_]:=ert[n]=1+Sum[Times@@ert/@y,{y,IntegerPartitions[n-1]}];
    Array[ert,30]
  • PARI
    seq(n)={my(v=vector(n)); for(n=1, n, v[n] = 1 + polcoef(1/prod(k=1, n-1, 1 - v[k]*x^k + O(x^n)), n-1)); concat([1], v)} \\ Andrew Howroyd, Aug 26 2018

Formula

O.g.f.: 1/(1 - x) + x Product_{i > 0} 1/(1 - a(i) x^i).

A301467 Number of enriched r-trees of size n with no empty subtrees.

Original entry on oeis.org

1, 2, 4, 8, 20, 48, 136, 360, 1040, 2944, 8704, 25280, 76320, 226720, 692992, 2096640, 6470016, 19799936, 61713152, 190683520, 598033152, 1863995392, 5879859200, 18438913536, 58464724992, 184356152832, 586898946048, 1859875518464, 5941384080384, 18901502482432
Offset: 1

Views

Author

Gus Wiseman, Mar 21 2018

Keywords

Comments

An enriched r-tree of size n > 0 with no empty subtrees is either a single node of size n, or a finite nonempty sequence of enriched r-trees with no empty subtrees and with weakly decreasing sizes summing to n - 1.

Examples

			The a(4) = 8 enriched r-trees with no empty subtrees: 4, (3), (21), ((2)), (111), ((11)), ((1)1), (((1))).
The a(5) = 20 enriched r-trees with no empty subtrees:
  5,
  (4), ((3)), ((21)), (((2))), ((111)), (((11))), (((1)1)), ((((1)))),
  (31), (22), (2(1)), ((2)1), ((1)2), ((11)1), ((1)(1)), (((1))1),
  (211), ((1)11),
  (1111).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(b(n-i*j, i-1)* a(i)^j, j=0..n/i)))
        end:
    a:= n-> `if`(n<2, n, 1+b(n-1$2)):
    seq(a(n), n=1..30);  # Alois P. Heinz, Jun 21 2018
  • Mathematica
    pert[n_]:=pert[n]=If[n===1,1,1+Sum[Times@@pert/@y,{y,IntegerPartitions[n-1]}]];
    Array[pert,30]
    (* Second program: *)
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0,
         Sum[b[n - i*j, i - 1] a[i]^j, {j, 0, n/i}]]];
    a[n_] := a[n] = If[n < 2, n, 1 + b[n-1, n-1]];
    Array[a, 30] (* Jean-François Alcover, May 09 2021, after Alois P. Heinz *)
  • PARI
    seq(n)={my(v=vector(n)); v[1]=1; for(n=2, n, v[n] = 1 + polcoef(1/prod(k=1, n-1, 1 - v[k]*x^k + O(x^n)), n-1)); v} \\ Andrew Howroyd, Aug 26 2018

Formula

O.g.f.: x^2/(1 - x) + x Product_{i > 0} 1/(1 - a(i) x^i).

A301422 Regular triangle where T(n,k) is the number of r-trees of size n with k leaves.

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, 19, 14, 5, 1, 0, 1, 12, 36, 40, 21, 6, 1, 0, 1, 16, 65, 102, 75, 30, 7, 1, 0, 1, 20, 106, 223, 224, 123, 40, 8, 1, 0, 1, 25, 168, 457, 604, 439, 191, 52, 9, 1, 0, 1, 30, 248, 847, 1433, 1346, 764, 276
Offset: 1

Views

Author

Gus Wiseman, Mar 20 2018

Keywords

Comments

An r-tree (A093637) of size n > 0 is a finite sequence of r-trees with weakly decreasing sizes summing to n - 1. This is a similar construction to p-trees (A196545) except that r-trees are not required to be series-reduced and are weighted by all nodes (including the root) rather than just the leaves.

Examples

			Triangle begins:
  1
  1   0
  1   1   0
  1   2   1   0
  1   4   3   1   0
  1   6   8   4   1   0
  1   9  19  14   5   1   0
  1  12  36  40  21   6   1   0
  1  16  65 102  75  30   7   1   0
  1  20 106 223 224 123  40   8   1   0
  1  25 168 457 604 439 191  52   9   1   0
  ...
The T(6,3) = 8 r-trees: (((ooo))), (((oo)o)), (((o)oo)), (((oo))o), (((o)o)o), ((oo)(o)), (((o))oo), ((o)(o)o).
		

Crossrefs

Programs

  • Mathematica
    rtrees[n_]:=Join@@Table[Tuples[rtrees/@y],{y,IntegerPartitions[n-1]}];
    Table[Length[Select[rtrees[n],Count[#,{},{-2}]===k&]],{n,8},{k,n}]
  • PARI
    A(n)={my(v=vector(n)); v[1]=y; for(n=2, n, v[n] = polcoef(1/prod(k=1, n-1, 1 - v[k]*x^k + O(x^n)), n-1)); vector(n, k, Vecrev(v[k]/y,k))}
    { my(T=A(10)); for(n=1, #T, print(T[n])) } \\ Andrew Howroyd, Aug 26 2018

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}]

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}]

A301343 Regular triangle where T(n,k) is the number of planted achiral (or generalized Bethe) trees with n nodes and k leaves.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Mar 19 2018

Keywords

Examples

			Triangle begins:
1
1  0
1  1  0
1  1  1  0
1  2  1  1  0
1  2  1  1  1  0
1  3  2  2  1  1  0
1  3  2  2  1  1  1  0
1  4  2  4  1  2  1  1  0
1  4  3  4  1  3  1  1  1  0
1  5  3  6  2  4  1  2  1  1  0
The T(9,4) = 4 planted achiral trees: (((((oooo))))), ((((oo)(oo)))), (((oo))((oo))), ((o)(o)(o)(o)).
		

Crossrefs

Row sums are A003238. A version without the zeroes or first row is A214575.

Programs

  • Mathematica
    tri[n_,k_]:=If[k===1,1,If[k>=n,0,Sum[tri[n-k,d],{d,Divisors[k]}]]];
    Table[tri[n,k],{n,10},{k,n}]

Formula

T(n,1) = 1, T(n,k) = 0 if n <= k, otherwise T(n,k) = Sum_{d|k} T(n - k, d).

A320270 Number of unlabeled balanced semi-binary rooted trees with n nodes.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 6, 7, 10, 13, 19, 25, 35, 46, 65, 88, 124, 171, 242, 334, 470, 653, 921, 1287, 1822, 2565, 3640, 5144, 7311, 10360, 14734, 20918, 29781, 42361, 60389, 86069, 122893, 175479, 250922, 358863
Offset: 1

Views

Author

Gus Wiseman, Oct 08 2018

Keywords

Comments

An unlabeled rooted tree is semi-binary if all out-degrees are <= 2, and balanced if all leaves are the same distance from the root. The number of semi-binary trees with n nodes is equal to the number of binary trees with n+1 leaves; see A001190.

Examples

			The a(1) = 1 through a(7) = 6 balanced semi-binary rooted trees:
  o  (o)  (oo)   ((oo))   (((oo)))   ((o)(oo))    ((oo)(oo))
          ((o))  (((o)))  ((o)(o))   ((((oo))))   (((o)(oo)))
                          ((((o))))  (((o)(o)))   (((((oo)))))
                                     (((((o)))))  ((((o)(o))))
                                                  (((o))((o)))
                                                  ((((((o))))))
		

Crossrefs

Programs

  • Mathematica
    saur[n_]:=If[n==1,{{}},Join@@Table[Select[Union[Sort/@Tuples[saur/@ptn]],SameQ@@Length/@Position[#,{}]&],{ptn,Select[IntegerPartitions[n-1],Length[#]<=2&]}]];
    Table[Length[saur[n]],{n,20}]

A301470 Signed recurrence over enriched r-trees: a(n) = (-1)^n + Sum_y Product_{i in y} a(y) where the sum is over all integer partitions of n - 1.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 2, 3, 5, 9, 15, 27, 47, 87, 155, 288, 524, 983, 1813, 3434, 6396, 12174, 22891, 43810, 82925, 159432, 303559, 585966, 1121446, 2171341, 4172932, 8106485, 15635332, 30445899, 58925280, 115014681, 223210718, 436603718, 849480835, 1664740873
Offset: 0

Views

Author

Gus Wiseman, Mar 21 2018

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1,
         `if`(i<1, 0, b(n, i-1)+a(i)*b(n-i, min(n-i, i))))
        end:
    a:= n-> `if`(n<2, 1-n, b(n-2$2)+b(n-1, n-2)):
    seq(a(n), n=0..45);  # Alois P. Heinz, Jun 23 2018
  • Mathematica
    a[n_]:=a[n]=(-1)^n+Sum[Times@@a/@y,{y,IntegerPartitions[n-1]}];
    Array[a,30]
    (* Second program: *)
    b[n_, i_] := b[n, i] = If[n == 0, 1,
         If[i < 1, 0, b[n, i - 1] + a[i] b[n - i, Min[n - i, i]]]];
    a[n_] := If[n < 2, 1 - n, b[n - 2, n - 2] + b[n - 1, n - 2]];
    a /@ Range[0, 45] (* Jean-François Alcover, May 20 2021, after Alois P. Heinz *)

Formula

O.g.f.: 1/(1 + x) + x Product_{i > 0} 1/(1 - a(i) x^i).
a(n) = Sum_t (-1)^w(t) where the sum is over all enriched r-trees of size n and w(t) is the sum of leaves of t.

A301469 Signed recurrence over enriched r-trees: a(n) = 2 * (-1)^n + Sum_y Product_{i in y} a(y) where the sum is over all integer partitions of n - 1.

Original entry on oeis.org

2, -1, 1, 0, 0, 1, 0, 1, 1, 1, 2, 3, 3, 6, 7, 11, 17, 23, 35, 53, 75, 119, 173, 264, 398, 603, 911, 1411, 2114, 3279, 4977, 7696, 11760, 18253, 27909, 43451, 66675, 103945, 160096, 249904, 385876, 603107, 933474, 1461967, 2266384, 3553167, 5521053, 8664117, 13485744
Offset: 0

Views

Author

Gus Wiseman, Mar 21 2018

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=a[n]=2(-1)^n+Sum[Times@@a/@y,{y,IntegerPartitions[n-1]}];
    Array[a,30]

Formula

O.g.f.: 2/(1 + x) + x Product_{i > 0} 1/(1 - a(i) x^i).
a(n) = Sum_t 2^k * (-1)^w where the sum is over all enriched r-trees of size n, k is the number of leaves, and w is the sum of leaves.
Showing 1-10 of 11 results. Next