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 27 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

A298426 Regular triangle where T(n,k) is number of k-ary rooted trees with n nodes.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 2, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 3, 0, 1, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 1, 6, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 11, 4, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 23, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Gus Wiseman, Jan 19 2018

Keywords

Comments

Row sums are A298422.

Examples

			Triangle begins:
1
0  1
0  1  1
0  1  0  1
0  1  1  0  1
0  1  0  0  0  1
0  1  2  1  0  0  1
0  1  0  0  0  0  0  1
0  1  3  0  1  0  0  0  1
0  1  0  2  0  0  0  0  0  1
0  1  6  0  0  1  0  0  0  0  1
0  1  0  0  0  0  0  0  0  0  0  1
0  1  11 4  2  0  1  0  0  0  0  0  1
0  1  0  0  0  0  0  0  0  0  0  0  0  1
0  1  23 0  0  0  0  1  0  0  0  0  0  0  1
0  1  0  8  0  2  0  0  0  0  0  0  0  0  0  1
		

Crossrefs

Programs

  • Mathematica
    nn=16;
    arut[n_,k_]:=If[n===1,{{}},Join@@Function[c,Union[Sort/@Tuples[arut[#,k]&/@c]]]/@Select[IntegerPartitions[n-1],Length[#]===k&]]
    Table[arut[n,k]//Length,{n,nn},{k,0,n-1}]

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

A298204 Number of unlabeled rooted trees with n nodes in which all outdegrees are either 0, 1, or 3.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 9, 16, 29, 55, 104, 200, 389, 763, 1507, 3002, 6010, 12102, 24484, 49751, 101475, 207723, 426542, 878451, 1813945, 3754918, 7790326, 16196629, 33739335, 70410401, 147187513, 308171861, 646188276, 1356847388, 2852809425, 6005542176
Offset: 1

Views

Author

Gus Wiseman, Jan 14 2018

Keywords

Examples

			The a(7) = 9 trees: ((((((o)))))), ((((ooo)))), (((oo(o)))), ((oo((o)))), ((o(o)(o))), (oo(((o)))), (oo(ooo)), (o(o)((o))), ((o)(o)(o)).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, v) option remember; `if`(n=0,
          `if`(v=0, 1, 0), `if`(i<1 or v<1 or n `if`(n<2, n, add(b(n-1$2, j), j=[1, 3])):
    seq(a(n), n=1..40);  # Alois P. Heinz, Jan 30 2018
  • Mathematica
    multing[n_,k_]:=Binomial[n+k-1,k];
    a[n_]:=a[n]=If[n===1,1,Sum[Product[multing[a[x],Count[ptn,x]],{x,Union[ptn]}],{ptn,Select[IntegerPartitions[n-1],MemberQ[{1,3},Length[#]]&]}]];
    Table[a[n],{n,40}]
    (* Second program: *)
    b[n_, i_, v_] := b[n, i, v] = If[n == 0,
         If[v == 0, 1, 0], If[i < 1 || v < 1 || n < v, 0,
         If[n == v, 1, Sum[Binomial[a[i] + j - 1, j]*
         b[n - i*j, i - 1, v - j], {j, 0, Min[n/i, v]}]]]];
    a[n_] := If[n < 2, n, Sum[b[n - 1, n - 1, j], {j, {1, 3}}]];
    Array[a, 40] (* Jean-François Alcover, May 10 2021, after Alois P. Heinz *)

A300439 Number of odd enriched p-trees of weight n (all outdegrees are odd).

Original entry on oeis.org

1, 1, 2, 2, 5, 7, 18, 29, 75, 132, 332, 651, 1580, 3268, 7961, 16966, 40709, 89851, 215461, 484064, 1159568, 2641812, 6337448, 14622880, 35051341, 81609747, 196326305, 459909847, 1107083238, 2611592457, 6299122736, 14926657167, 36069213786, 85809507332
Offset: 1

Views

Author

Gus Wiseman, Mar 05 2018

Keywords

Comments

An odd enriched p-tree of weight n > 0 is either a single node of weight n, or a finite odd-length sequence of at least 3 odd enriched p-trees whose weights are weakly decreasing and sum to n.

Examples

			The a(6) = 7 odd enriched p-trees: 6, (411), (321), (222), ((111)21), ((211)11), (21111).
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=1+Sum[Times@@f/@y,{y,Select[IntegerPartitions[n],Length[#]>1&&OddQ[Length[#]]&]}];
    Array[f,40]
  • 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*x^n)) - 1/prod(k=1, n-1, 1 + v[k]*x^k + O(x*x^n)), n)/2); v} \\ Andrew Howroyd, Aug 26 2018

A300436 Number of odd p-trees of weight n (all proper terminal subtrees have odd weight).

Original entry on oeis.org

1, 1, 1, 2, 2, 5, 5, 12, 13, 35, 37, 98, 107, 304, 336, 927, 1037, 3010, 3367, 9585, 10924, 32126, 36438, 105589, 121045, 359691, 412789, 1211214, 1398168, 4188930, 4831708, 14315544, 16636297, 50079792, 58084208, 173370663, 202101971, 611487744, 712709423
Offset: 1

Views

Author

Gus Wiseman, Mar 05 2018

Keywords

Comments

An odd p-tree of weight n > 0 is either a single node (if n = 1) or a finite sequence of at least 3 odd p-trees whose weights are weakly decreasing odd numbers summing to n.

Examples

			The a(7) = 5 odd p-trees: ((ooo)(ooo)o), (((ooo)oo)oo), ((ooooo)oo), ((ooo)oooo), (ooooooo).
		

Crossrefs

Programs

  • Mathematica
    b[n_]:=b[n]=If[n>1,0,1]+Sum[Times@@b/@y,{y,Select[IntegerPartitions[n],Length[#]>1&&And@@OddQ/@#&]}];
    Table[b[n],{n,40}]

Formula

O.g.f: x + Product_{n odd} 1/(1 - a(n)*x^n) - Sum_{n odd} a(n)*x^n. - Gus Wiseman, Aug 27 2018

Extensions

Name corrected by Gus Wiseman, Aug 27 2018

A358334 Number of twice-partitions of n into odd-length partitions.

Original entry on oeis.org

1, 1, 2, 4, 7, 13, 25, 43, 77, 137, 241, 410, 720, 1209, 2073, 3498, 5883, 9768, 16413, 26978, 44741, 73460, 120462, 196066, 320389, 518118, 839325, 1353283, 2178764, 3490105, 5597982, 8922963, 14228404, 22609823, 35875313, 56756240, 89761600, 141410896, 222675765
Offset: 0

Views

Author

Gus Wiseman, Dec 01 2022

Keywords

Comments

A twice-partition of n (A063834) is a sequence of integer partitions, one of each part of an integer partition of n.

Examples

			The a(0) = 1 through a(5) = 13 twice-partitions:
  ()  ((1))  ((2))     ((3))        ((4))           ((5))
             ((1)(1))  ((111))      ((211))         ((221))
                       ((2)(1))     ((2)(2))        ((311))
                       ((1)(1)(1))  ((3)(1))        ((3)(2))
                                    ((111)(1))      ((4)(1))
                                    ((2)(1)(1))     ((11111))
                                    ((1)(1)(1)(1))  ((111)(2))
                                                    ((211)(1))
                                                    ((2)(2)(1))
                                                    ((3)(1)(1))
                                                    ((111)(1)(1))
                                                    ((2)(1)(1)(1))
                                                    ((1)(1)(1)(1)(1))
		

Crossrefs

For multiset partitions of integer partitions: A356932, ranked by A356935.
For odd length instead of lengths we have A358824.
For odd sums instead of lengths we have A358825.
For odd sums also we have A358827.
For odd length also we have A358834.
A000041 counts integer partitions.
A027193 counts odd-length partitions, ranked by A026424.
A055922 counts partitions with odd multiplicities, also odd parts A117958.
A063834 counts twice-partitions, strict A296122, row-sums of A321449.

Programs

  • Mathematica
    twiptn[n_]:=Join@@Table[Tuples[IntegerPartitions/@ptn],{ptn,IntegerPartitions[n]}];
    Table[Length[Select[twiptn[n],OddQ[Times@@Length/@#]&]],{n,0,10}]
  • PARI
    P(n,y) = {1/prod(k=1, n, 1 - y*x^k + O(x*x^n))}
    R(u,y) = {1/prod(k=1, #u, 1 - u[k]*y*x^k + O(x*x^#u))}
    seq(n) = {my(u=Vec(P(n,1)-P(n,-1))/2); Vec(R(u, 1), -(n+1))} \\ Andrew Howroyd, Dec 30 2022

Formula

G.f.: 1/Product_{k>=1} (1 - A027193(k)*x^k). - Andrew Howroyd, Dec 30 2022

Extensions

Terms a(21) and beyond from Andrew Howroyd, Dec 30 2022

A295461 Number of unlabeled rooted trees with 2n + 1 nodes in which all outdegrees are even.

Original entry on oeis.org

1, 1, 2, 5, 12, 33, 91, 264, 780, 2365, 7274, 22727, 71784, 229094, 737215, 2390072, 7798020, 25587218, 84377881, 279499063, 929556155, 3102767833, 10390936382, 34903331506, 117564309276, 396994228503, 1343716120550, 4557952756658, 15491856887741
Offset: 0

Views

Author

Gus Wiseman, Jan 13 2018

Keywords

Examples

			The a(3) = 5 trees: (o(o(oo))), (o(oooo)), ((oo)(oo)), (ooo(oo)), (oooooo).
		

Crossrefs

Programs

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

A298120 Matula-Goebel numbers of rooted trees in which all positive outdegrees are odd.

Original entry on oeis.org

1, 2, 3, 5, 8, 11, 12, 18, 19, 20, 27, 30, 31, 32, 37, 44, 45, 48, 50, 61, 66, 67, 71, 72, 75, 76, 80, 99, 103, 108, 110, 113, 114, 120, 124, 125, 127, 128, 131, 148, 157, 162, 165, 171, 176, 180, 186, 190, 192, 193, 197, 200, 222, 223, 229, 242, 243, 244, 264
Offset: 1

Views

Author

Gus Wiseman, Jan 12 2018

Keywords

Examples

			Sequence of trees begins:
1  o
2  (o)
3  ((o))
5  (((o)))
8  (ooo)
11 ((((o))))
12 (oo(o))
18 (o(o)(o))
19 ((ooo))
20 (oo((o)))
27 ((o)(o)(o))
30 (o(o)((o)))
31 (((((o)))))
32 (ooooo)
37 ((oo(o)))
44 (oo(((o))))
45 ((o)(o)((o)))
48 (oooo(o))
50 (o((o))((o)))
		

Crossrefs

Programs

  • Mathematica
    primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    otQ[n_]:=Or[n===1,With[{m=primeMS[n]},OddQ@Length@m&&And@@otQ/@m]];
    Select[Range[1000],otQ]
Showing 1-10 of 27 results. Next