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 53 results. Next

A000598 Number of rooted ternary trees with n nodes; number of n-carbon alkyl radicals C(n)H(2n+1) ignoring stereoisomers.

Original entry on oeis.org

1, 1, 1, 2, 4, 8, 17, 39, 89, 211, 507, 1238, 3057, 7639, 19241, 48865, 124906, 321198, 830219, 2156010, 5622109, 14715813, 38649152, 101821927, 269010485, 712566567, 1891993344, 5034704828, 13425117806, 35866550869, 95991365288, 257332864506, 690928354105
Offset: 0

Views

Author

Keywords

Comments

Number of unlabeled rooted trees in which each node has out-degree <= 3.
Ignoring stereoisomers means that the children of a node are unordered. They can be permuted in any way and it is still the same tree. See A000625 for the analogous sequence with stereoisomers counted.
In alkanes every carbon has valence exactly 4 and every hydrogen has valence exactly 1. But the trees considered here are just the carbon "skeletons" (with all the hydrogen atoms stripped off) so now each carbon bonds to 1 to 4 other carbons. The out-degree is then <= 3.
Other descriptions of this sequence: quartic planted trees with n nodes; ternary rooted trees with n nodes and height at most 3.
The number of aliphatic amino acids with n carbon atoms in the side chain, and no rings or double bonds, has the same growth as this sequence. - Konrad Gruetzmann, Aug 13 2012

Examples

			From _Joerg Arndt_, Feb 25 2017: (Start)
The a(5) = 8 rooted trees with 5 nodes and out-degrees <= 3 are:
:         level sequence    out-degrees (dots for zeros)
:     1:  [ 0 1 2 3 4 ]    [ 1 1 1 1 . ]
:  O--o--o--o--o
:
:     2:  [ 0 1 2 3 3 ]    [ 1 1 2 . . ]
:  O--o--o--o
:        .--o
:
:     3:  [ 0 1 2 3 2 ]    [ 1 2 1 . . ]
:  O--o--o--o
:     .--o
:
:     4:  [ 0 1 2 3 1 ]    [ 2 1 1 . . ]
:  O--o--o--o
:  .--o
:
:     5:  [ 0 1 2 2 2 ]    [ 1 3 . . . ]
:  O--o--o
:     .--o
:     .--o
:
:     6:  [ 0 1 2 2 1 ]    [ 2 2 . . . ]
:  O--o--o
:     .--o
:  .--o
:
:     7:  [ 0 1 2 1 2 ]    [ 2 1 . 1 . ]
:  O--o--o
:  .--o--o
:
:     8:  [ 0 1 2 1 1 ]    [ 3 1 . . . ]
:  O--o--o
:  .--o
:  .--o
(End)
		

References

  • N. L. Biggs et al., Graph Theory 1736-1936, Oxford, 1976, p. 62 (quoting Cayley, who is wrong).
  • A. Cayley, On the mathematical theory of isomers, Phil. Mag. vol. 67 (1874), 444-447 (a(6) is wrong).
  • J. L. Faulon, D. Visco and D. Roe, Enumerating Molecules, In: Reviews in Computational Chemistry Vol. 21, Ed. K. Lipkowitz, Wiley-VCH, 2005.
  • R. A. Fisher, Contributions to Mathematical Statistics, Wiley, 1950, 41.397.
  • J. L. Gross and J. Yellen, eds., Handbook of Graph Theory, CRC Press, 2004; p. 529.
  • Handbook of Combinatorics, North-Holland '95, p. 1963.
  • Knop, Mueller, Szymanski and Trinajstich, Computer generation of certain classes of molecules.
  • D. Perry, The number of structural isomers ..., J. Amer. Chem. Soc. 54 (1932), 2918-2920.
  • G. Polya, Mathematical and Plausible Reasoning, Vol. 1 Prob. 4 pp. 85; 233.
  • 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

Programs

  • Maple
    N := 45; G000598 := 0: i := 0: while i<(N+1) do G000598 := series(1+z*(G000598^3/6+subs(z=z^2,G000598)*G000598/2+subs(z=z^3,G000598)/3)+O(z^(N+1)),z,N+1): t[ i ] := G000598: i := i+1: od: A000598 := n->coeff(G000598,z,n);
    # Another Maple program for g.f. G000598:
    G000598 := 1; f := proc(n) global G000598; coeff(series(1+(1/6)*x*(G000598^3+3*G000598*subs(x=x^2,G000598)+2*subs(x=x^3,G000598)),x, n+1),x,n); end; for n from 1 to 50 do G000598 := series(G000598+f(n)*x^n,x,n+1); od; G000598;
    spec := [S, {Z=Atom, S=Union(Z, Prod(Z, Set(S, card=3)))}, unlabeled]: [seq(combstruct[count](spec, size=n), n=0..20)];
  • Mathematica
    m = 45; Clear[f]; f[1, x_] := 1+x; f[n_, x_] := f[n, x] = Expand[1+x*(f[n-1, x]^3/6 + f[n-1, x^2]*f[n-1, x]/2 + f[n-1, x^3]/3)][[1 ;; n]]; Do[f[n, x], {n, 2, m}]; CoefficientList[f[m, x], x]
    (* second program (after N. J. A. Sloane): *)
    m = 45; gf[] = 0; Do[gf[z] = 1 + z*(gf[z]^3/6 + gf[z^2]*gf[z]/2 + gf[z^3]/3) + O[z]^m // Normal, m]; CoefficientList[gf[z], z]  (* Jean-François Alcover, Sep 23 2014, updated Jan 11 2018 *)
    b[0, i_, t_, k_] = 1; m = 3; (* m = maximum children *)
    b[n_,i_,t_,k_]:= b[n,i,t,k]= If[i<1,0,
      Sum[Binomial[b[i-1, i-1, k, k] + j-1, j]*
      b[n-i*j, i-1, t-j, k], {j, 0, Min[t, n/i]}]];
    Join[{1},Table[b[n-1, n-1, m, m], {n, 1, 35}]] (* Robert A. Russell, Dec 27 2022 *)
  • PARI
    seq(n)={my(g=O(x)); for(n=1, n, g = 1 + x*(g^3/6 + subst(g,x,x^2)*g/2 + subst(g,x,x^3)/3) + O(x^n)); Vec(g)} \\ Andrew Howroyd, May 22 2018
    
  • SageMath
    def seq(n):
        B = PolynomialRing(QQ, 't', n+1);t = B.gens()
        R. = B[[]]
        T = sum([t[i] * z^i for i in range(1,n+1)]) + O(z^(n+1))
        lhs, rhs = T, 1 + z/6 * (T(z)^3 + 3*T(z)*T(z^2) + 2*T(z^3))
        I = B.ideal([lhs.coefficients()[i] - rhs.coefficients()[i] for i in range(n)])
        return [I.reduce(t[i]) for i in range(1,n+1)]
    seq(33) # Chris Grossack, Mar 31 2025

Formula

G.f. A(x) satisfies A(x) = 1 + (1/6)*x*(A(x)^3 + 3*A(x)*A(x^2) + 2*A(x^3)).
a(n) ~ c * d^n / n^(3/2), where d = 1/A261340 = 2.8154600331761507465266167782426995425365065396907..., c = 0.517875906458893536993162356992854345458168348098... . - Vaclav Kotesovec, Aug 15 2015

Extensions

Additional comments from Steve Strand (snstrand(AT)comcast.net), Aug 20 2003

A298422 Number of rooted trees with n nodes in which all positive outdegrees are the same.

Original entry on oeis.org

1, 1, 2, 2, 3, 2, 5, 2, 6, 4, 9, 2, 20, 2, 26, 12, 53, 2, 120, 2, 223, 43, 454, 2, 1100, 11, 2182, 215, 4902, 2, 11446, 2, 24744, 1242, 56014, 58, 131258, 2, 293550, 7643, 676928, 2, 1582686, 2, 3627780, 49155, 8436382, 2, 19809464, 50, 46027323, 321202
Offset: 1

Views

Author

Gus Wiseman, Jan 19 2018

Keywords

Comments

Row sums of A298426.

Examples

			The a(9) = 6 trees: ((((((((o)))))))), (o(o(o(oo)))), (o((oo)(oo))), ((oo)(o(oo))), (ooo(oooo)), (oooooooo).
		

Crossrefs

Programs

  • Mathematica
    srut[n_]:=srut[n]=If[n===1,{{}},Select[Join@@Function[c,Union[Sort/@Tuples[srut/@c]]]/@Select[IntegerPartitions[n-1],Function[ptn,And@@(Divisible[#-1,Length[ptn]]&/@ptn)]],SameQ@@Length/@Cases[#,{},{0,Infinity}]&]];
    Table[srut[n]//Length,{n,20}]

Formula

a(n) = 2 <=> n in {A008864}. - Alois P. Heinz, Jan 20 2018

Extensions

a(44)-a(52) from Alois P. Heinz, Jan 20 2018

A298118 Number of unlabeled rooted trees with n nodes in which all positive outdegrees are odd.

Original entry on oeis.org

1, 1, 1, 2, 3, 6, 11, 21, 40, 80, 159, 322, 657, 1356, 2816, 5896, 12407, 26267, 55861, 119331, 255878, 550665, 1188786, 2574006, 5588177, 12162141, 26529873, 57993624, 127020653, 278716336, 612617523, 1348680531, 2973564157, 6565313455, 14514675376
Offset: 1

Views

Author

Gus Wiseman, Jan 12 2018

Keywords

Examples

			The a(6) = 6 trees: (((((o))))), (((ooo))), ((oo(o))), (oo((o))), (o(o)(o)), (ooooo).
		

Crossrefs

Programs

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

Formula

a(n) ~ c * d^n / n^(3/2), where d = 2.30984417428419893876754252289588812511559... and c = 0.5598122522173731208680575003383895445787... - Vaclav Kotesovec, Jun 04 2019

Extensions

a(24)-a(35) from Alois P. Heinz, Jan 12 2018

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

A301480 Number of rooted twice-partitions of n.

Original entry on oeis.org

1, 1, 2, 4, 8, 15, 30, 54, 103, 186, 345, 606, 1115, 1936, 3466, 6046, 10630, 18257, 31927, 54393, 93894, 159631, 272155, 458891, 779375, 1305801, 2196009, 3667242, 6130066, 10170745, 16923127, 27942148, 46211977, 76039205, 125094369, 204952168, 335924597
Offset: 1

Views

Author

Gus Wiseman, Mar 22 2018

Keywords

Comments

A rooted partition of n is an integer partition of n - 1. A rooted twice-partition of n is a choice of a rooted partition of each part in a rooted partition of n.

Examples

			The a(5) = 8 rooted twice-partitions: ((3)), ((21)), ((111)), ((2)()), ((11)()), ((1)(1)), ((1)()()), (()()()()).
The a(6) = 15 rooted twice-partitions:
(4), (31), (22), (211), (1111),
(3)(), (21)(), (111)(), (2)(1), (11)(1),
(2)()(), (11)()(), (1)(1)(),
(1)()()(),
()()()()().
		

Crossrefs

Programs

  • Mathematica
    nn=30;
    ser=x*Product[1/(1-PartitionsP[n-1]x^n),{n,nn}];
    Table[SeriesCoefficient[ser,{x,0,n}],{n,nn}]
  • PARI
    seq(n)={Vec(1/prod(k=1, n-1, 1 - numbpart(k-1)*x^k + O(x^n)))} \\ Andrew Howroyd, Aug 29 2018

Formula

O.g.f.: x * Product_{n > 0} 1/(1 - P(n-1) x^n) where P = A000041.

A124343 Number of rooted trees on n nodes with thinning limbs.

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 21, 38, 78, 153, 314, 632, 1313, 2700, 5646, 11786, 24831, 52348, 111027, 235834, 502986, 1074739, 2303146, 4944507, 10639201, 22930493, 49511948, 107065966, 231874164, 502834328, 1091842824, 2373565195, 5165713137, 11254029616, 24542260010
Offset: 1

Views

Author

Christian G. Bower, Oct 30 2006, suggested by Franklin T. Adams-Watters

Keywords

Comments

A rooted tree with thinning limbs is such that if a node has k children, all its children have at most k children.

Examples

			The a(5) = 6 trees are ((((o)))), (o((o))), (o(oo)), ((o)(o)), (oo(o)), (oooo). - _Gus Wiseman_, Jan 25 2018
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, h, v) option remember; `if`(n=0,
          `if`(v=0, 1, 0), `if`(i<1 or v<1 or n A(n$2):
    seq(a(n), n=1..35);  # Alois P. Heinz, Jul 08 2014
  • Mathematica
    b[n_, i_, h_, v_] := b[n, i, h, v] = If[n==0, If[v==0, 1, 0], If[i<1 || v<1 || nJean-François Alcover, Mar 01 2016, after Alois P. Heinz *)

Extensions

More terms from Alois P. Heinz, Jul 04 2014

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

A318753 Number A(n,k) of rooted trees with n nodes such that no more than k subtrees extending from the same node have the same number of nodes; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 2, 2, 0, 0, 1, 1, 2, 3, 3, 0, 0, 1, 1, 2, 4, 7, 6, 0, 0, 1, 1, 2, 4, 8, 15, 12, 0, 0, 1, 1, 2, 4, 9, 18, 34, 25, 0, 0, 1, 1, 2, 4, 9, 19, 43, 79, 51, 0, 0, 1, 1, 2, 4, 9, 20, 46, 102, 190, 111, 0, 0, 1, 1, 2, 4, 9, 20, 47, 110, 250, 457, 240, 0
Offset: 0

Views

Author

Alois P. Heinz, Sep 02 2018

Keywords

Examples

			Square array A(n,k) begins:
  0,  0,  0,   0,   0,   0,   0,   0,   0, ...
  1,  1,  1,   1,   1,   1,   1,   1,   1, ...
  0,  1,  1,   1,   1,   1,   1,   1,   1, ...
  0,  1,  2,   2,   2,   2,   2,   2,   2, ...
  0,  2,  3,   4,   4,   4,   4,   4,   4, ...
  0,  3,  7,   8,   9,   9,   9,   9,   9, ...
  0,  6, 15,  18,  19,  20,  20,  20,  20, ...
  0, 12, 34,  43,  46,  47,  48,  48,  48, ...
  0, 25, 79, 102, 110, 113, 114, 115, 115, ...
		

Crossrefs

Rows n=0-2 give: A000004, A000012, A057427.
Main diagonal gives A000081.
Cf. A318754.

Programs

  • Maple
    g:= proc(n, i, k) option remember; `if`(n=0, 1, `if`(i<1, 0, add(
          binomial(A(i, k)+j-1, j)*g(n-i*j, i-1, k), j=0..min(k, n/i))))
        end:
    A:= (n, k)-> g(n-1$2, k):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    g[n_, i_, k_] := g[n, i, k] = If[n == 0, 1, If[i < 1, 0, Sum[Binomial[A[i, k] + j - 1, j]*g[n - i*j, i - 1, k], {j, 0, Min[k, n/i]}]]];
    A[n_, k_] := g[n - 1, n - 1, k];
    Table[A[n, d - n], {d, 0, 14}, {n, 0, d}] // Flatten (* Jean-François Alcover, May 27 2019, after Alois P. Heinz *)

Formula

A(n,k) = Sum_{j=0..k} A318754(n,j) for n > 0.
A(n,n+j) = A000081(n) for j >= -1.
Showing 1-10 of 53 results. Next