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

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

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

A303023 Number of anti-binary (no binary branchings) unlabeled rooted trees with n nodes.

Original entry on oeis.org

1, 1, 1, 2, 4, 8, 16, 32, 66, 139, 297, 642, 1404, 3097, 6888, 15428, 34770, 78785, 179397, 410264, 941935, 2170275, 5016604, 11630024, 27034824, 63000261, 147148341, 344419767, 807746487, 1897829065, 4466643367, 10529301944, 24858143953, 58769113863
Offset: 1

Views

Author

Gus Wiseman, Aug 15 2018

Keywords

Examples

			The a(6) = 8 rooted trees:
  (((((o)))))
  (((ooo)))
  ((oo(o)))
  (oo((o)))
  (o(o)(o))
  ((oooo))
  (ooo(o))
  (ooooo)
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=1, 0, 1), `if`(i<1, 0,
          add(b(n-i*j, i-1, max(0, t-j))*binomial(a(i)+j-1, j), j=0..n/i)))
        end:
    a:= n-> `if`(n<2, n, b(n-1$2, 3)):
    seq(a(n), n=1..50);  # Alois P. Heinz, Aug 27 2018
  • Mathematica
    burt[n_]:=burt[n]=If[n==1,{{}},Join@@Table[Union[Sort/@Tuples[burt/@c]],{c,Select[IntegerPartitions[n-1],Length[#]!=2&]}]];
    Table[Length[burt[n]],{n,20}]
    (* Second program: *)
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t == 1, 0, 1], If[i < 1, 0, Sum[b[n-i*j, i-1, Max[0, t-j]]*Binomial[a[i]+j-1, j], {j, 0, n/i}]]];
    a[n_] := If[n < 2, n, b[n-1, n-1, 3]];
    Array[a, 50] (* Jean-François Alcover, May 16 2021, after Alois P. Heinz *)

Extensions

a(24)-a(34) from Alois P. Heinz, Aug 27 2018

A303025 Number of series-reduced anti-binary (no unary or binary branchings) unlabeled rooted trees with n nodes.

Original entry on oeis.org

1, 0, 0, 1, 1, 1, 2, 3, 4, 7, 11, 17, 28, 46, 74, 123, 205, 341, 571, 964, 1629, 2764, 4707, 8040, 13766, 23639, 40681, 70163, 121256, 209960, 364168, 632694, 1100906, 1918375, 3347346, 5848271, 10229977, 17915018, 31407088, 55116661, 96818589, 170229939
Offset: 1

Views

Author

Gus Wiseman, Aug 15 2018

Keywords

Examples

			The a(10) = 7 rooted trees:
  (oo(oo(ooo)))
  (o(ooo)(ooo))
  (oo(oooooo))
  (ooo(ooooo))
  (oooo(oooo))
  (ooooo(ooo))
  (ooooooooo)
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0), `if`(i<1, 0,
          add(b(n-i*j, i-1, max(0, t-j))*binomial(a(i)+j-1, j), j=0..n/i)))
        end:
    a:= n-> `if`(n<2, n, b(n-1$2, 3)):
    seq(a(n), n=1..50);  # Alois P. Heinz, Aug 27 2018
  • Mathematica
    zurt[n_]:=zurt[n]=If[n==1,{{}},Join@@Table[Union[Sort/@Tuples[zurt/@c]],{c,Select[IntegerPartitions[n-1],Length[#]>2&]}]];
    Table[Length[zurt[n]],{n,20}]
    (* Second program: *)
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t == 0, 1, 0], If[i < 1, 0, Sum[b[n-i*j, i - 1, Max[0, t-j]]*Binomial[a[i]+j-1, j], {j, 0, n/i}]]];
    a[n_] :=  If[n < 2, n, b[n-1, n-1, 3]];
    Array[a, 50] (* Jean-François Alcover, May 17 2021, after Alois P. Heinz *)

Extensions

a(36)-a(42) from Alois P. Heinz, Aug 27 2018

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

A298207 Numbers that are a product of zero, one, or three (not necessarily distinct) prime numbers.

Original entry on oeis.org

1, 2, 3, 5, 7, 8, 11, 12, 13, 17, 18, 19, 20, 23, 27, 28, 29, 30, 31, 37, 41, 42, 43, 44, 45, 47, 50, 52, 53, 59, 61, 63, 66, 67, 68, 70, 71, 73, 75, 76, 78, 79, 83, 89, 92, 97, 98, 99, 101, 102, 103, 105, 107, 109, 110, 113, 114, 116, 117, 124, 125, 127, 130
Offset: 1

Views

Author

Gus Wiseman, Jan 14 2018

Keywords

Examples

			1 is a product of zero primes so is in the sequence.
6 = 2 * 3 is a product of two primes so is not in the sequence.
12 = 2 * 2 * 3 is a product of three primes so is in the sequence.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local k; for k
          from 1+`if`(n=1, 0, a(n-1)) while not
          numtheory[bigomega](k) in {0, 1, 3} do od; k
        end:
    seq(a(n), n=1..70);  # Alois P. Heinz, Jan 15 2018
  • Mathematica
    Select[Range[200],MemberQ[{0,1,3},PrimeOmega[#]]&]
  • PARI
    is(n) = my(v=[0, 1, 3]); #setintersect([bigomega(n)], v)==1 \\ Felix Fröhlich, Jan 15 2018

Formula

Equals {A008578} union {A014612}.
Equals {A037144} minus {A001358}.

A298205 Matula-Goebel numbers of rooted trees in which all outdegrees are either 0, 1, or 3.

Original entry on oeis.org

1, 2, 3, 5, 8, 11, 12, 18, 19, 20, 27, 30, 31, 37, 44, 45, 50, 61, 66, 67, 71, 75, 76, 99, 103, 110, 113, 114, 124, 125, 127, 148, 157, 165, 171, 186, 190, 193, 197, 222, 229, 242, 244, 268, 275, 279, 283, 284, 285, 310, 317, 331, 333, 353, 363, 366, 370, 379
Offset: 1

Views

Author

Gus Wiseman, Jan 14 2018

Keywords

Examples

			Sequence of rooted 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)))))
37 ((oo(o)))
44 (oo(((o))))
45 ((o)(o)((o)))
50 (o((o))((o)))
		

Crossrefs

Programs

  • Mathematica
    primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    stQ[n_]:=Or[n===1,With[{m=primeMS[n]},MemberQ[{1,3},Length[m]]&&And@@stQ/@m]];
    Select[Range[10000],stQ]

A317097 Number of rooted trees with n nodes where the number of distinct branches under each node is <= 2.

Original entry on oeis.org

1, 1, 2, 4, 9, 20, 46, 106, 248, 583, 1393, 3343, 8111, 19801, 48719, 120489, 299787, 749258, 1881216, 4741340, 11993672, 30436507, 77471471, 197726053, 505917729, 1297471092, 3334630086, 8587369072, 22155278381, 57259037225, 148222036272, 384272253397
Offset: 1

Views

Author

Gus Wiseman, Aug 01 2018

Keywords

Comments

There can be more than two branches as long as there are not three distinct branches.

Examples

			The a(5) = 9 trees:
  ((((o))))
  (((oo)))
  ((o(o)))
  ((ooo))
  (o((o)))
  (o(oo))
  ((o)(o))
  (oo(o))
  (oooo)
		

Crossrefs

Programs

  • Mathematica
    semisameQ[u_]:=Length[Union[u]]<=2;
    nms[n_]:=nms[n]=If[n==1,{{}},Join@@Table[Select[Union[Sort/@Tuples[nms/@ptn]],semisameQ],{ptn,IntegerPartitions[n-1]}]];
    Table[Length[nms[n]],{n,10}]
  • PARI
    seq(n)={my(v=vector(n)); v[1]=1; for(n=1, n-1, v[n+1]=sum(k=1, n-1, sumdiv(k, d, v[d])*sumdiv(n-k, d, v[d])/2) + sumdiv(n, d, v[n/d]*(1 - (d-1)/2)) ); v} \\ Andrew Howroyd, Aug 28 2018

Extensions

Terms a(20) and beyond from Andrew Howroyd, Aug 28 2018

A317098 Number of series-reduced rooted trees with n unlabeled leaves where the number of distinct branches under each node is <= 2.

Original entry on oeis.org

1, 1, 2, 5, 12, 31, 80, 214, 576, 1595, 4448, 12625, 36146, 104662, 305251, 897417, 2654072, 7895394, 23601441, 70871693, 213660535, 646484951, 1962507610, 5975425743, 18243789556, 55841543003, 171320324878, 526738779846, 1622739134873, 5008518981670
Offset: 1

Views

Author

Gus Wiseman, Aug 01 2018

Keywords

Comments

There can be more than two branches as long as there are not three distinct branches.

Examples

			The a(5) = 12 trees:
  (o(o(o(oo))))
  (o(o(ooo)))
  (o((oo)(oo)))
  (o(oo(oo)))
  (o(oooo))
  ((oo)(o(oo)))
  ((oo)(ooo))
  (oo(o(oo)))
  (oo(ooo))
  (o(oo)(oo))
  (ooo(oo))
  (ooooo)
		

Crossrefs

Programs

  • Mathematica
    semisameQ[u_]:=Length[Union[u]]<=2;
    nms[n_]:=nms[n]=If[n==1,{{1}},Join@@Table[Select[Union[Sort/@Tuples[nms/@ptn]],semisameQ],{ptn,Rest[IntegerPartitions[n]]}]];
    Table[Length[nms[n]],{n,10}]
  • PARI
    seq(n)={my(v=vector(n)); v[1]=1; for(n=2, n, v[n]=sum(k=1, n-1, sumdiv(k, d, v[d])*sumdiv(n-k, d, v[d])/2) + sumdiv(n, d, v[n/d]*(1 - (d-1)/2)) ); v} \\ Andrew Howroyd, Aug 19 2018

Extensions

Terms a(21) and beyond from Andrew Howroyd, Aug 19 2018
Showing 1-10 of 11 results. Next