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

A100584 a(n) = A000676(n) - A000677(n).

Original entry on oeis.org

1, 1, -1, 1, 0, 1, 0, 3, 1, 7, 4, 19, 17, 63, 77, 217, 326, 815, 1435, 3533, 7227, 17709, 39704, 97010, 228123, 561216, 1366962, 3423504, 8601350, 22000341, 56612480, 147248370, 384885631
Offset: 0

Views

Author

N. J. A. Sloane, Dec 01 2004

Keywords

Crossrefs

Formula

a(n) = A000055(n) - 2*A000677(n). - Jean-François Alcover, Aug 23 2022

A000055 Number of trees with n unlabeled nodes.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 6, 11, 23, 47, 106, 235, 551, 1301, 3159, 7741, 19320, 48629, 123867, 317955, 823065, 2144505, 5623756, 14828074, 39299897, 104636890, 279793450, 751065460, 2023443032, 5469566585, 14830871802, 40330829030, 109972410221, 300628862480, 823779631721, 2262366343746, 6226306037178
Offset: 0

Views

Author

Keywords

Comments

Also, number of unlabeled 2-gonal 2-trees with n-1 2-gons, for n>0. [Corrected by Andrei Zabolotskii, Jul 29 2025]
Main diagonal of A054924.
Left border of A157905. - Gary W. Adamson, Mar 08 2009
From Robert Munafo, Jan 24 2010: (Start)
Also counts classifications of n items that require exactly n-1 binary partitions; see Munafo link at A005646, also A171871 and A171872.
The 11 trees for n = 7 are illustrated at the Munafo web link.
Link to A171871/A171872 conjectured by Robert Munafo, then proved by Andrew Weimholt and Franklin T. Adams-Watters on Dec 29 2009. (End)
This is also "Number of tree perfect graphs on n nodes" [see Hougardy]. - N. J. A. Sloane, Dec 04 2015
For n > 0, a(n) is the number of ways to arrange n-1 unlabeled non-intersecting circles on a sphere. - Vladimir Reshetnikov, Aug 25 2016
All trees for n=1 through n=12 are depicted in Chapter 1 of the Steinbach reference. On p. 6 appear encircled two trees (with n=10) which seem inequivalent only when considered as ordered (planar) trees. Earlier instances of such possibly (in)equivalent trees could appear from n=6 on (and from n=9 on without equivalence modulo plane symmetry) but are not drawn separately there. - M. F. Hasler, Aug 29 2017

Examples

			a(1) = 1 [o]; a(2) = 1 [o-o]; a(3) = 1 [o-o-o];
a(4) = 2 [o-o-o and o-o-o-o]
            |
            o
G.f. = 1 + x + x^2 + x^3 + 2*x^4 + 3*x^5 + 6*x^6 + 11*x^7 + 23*x^8 + ...
		

References

  • F. Bergeron, G. Labelle and P. Leroux, Combinatorial Species and Tree-Like Structures, Camb. 1998, p. 279.
  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 55.
  • N. L. Biggs et al., Graph Theory 1736-1936, Oxford, 1976, p. 49.
  • A. Cayley, On the analytical forms called trees, with application to the theory of chemical combinations, Reports British Assoc. Advance. Sci. 45 (1875), 257-305 = Math. Papers, Vol. 9, 427-460 (see p. 459).
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 295-316.
  • J. L. Gross and J. Yellen, eds., Handbook of Graph Theory, CRC Press, 2004; p. 526.
  • F. Harary, Graph Theory. Addison-Wesley, Reading, MA, 1969, p. 232.
  • F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973, p. 58 and 244.
  • D. E. Knuth, Fundamental Algorithms, 3d Ed. 1997, pp. 386-88.
  • R. C. Read and R. J. Wilson, An Atlas of Graphs, Oxford, 1998.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 138.
  • 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

Cf. A000676 (centered trees), A000677 (bicentered trees), A027416 (trees with a centroid), A102011 (trees with a bicentroid), A034853 (refined by diameter), A238414 (refined by maximum vertex degree).
Cf. A000081 (rooted trees), A000272 (labeled trees), A000169 (labeled rooted trees), A212809 (radius of convergence).
Cf. A036361 (labeled 2-trees), A036362 (labeled 3-trees), A036506 (labeled 4-trees), A054581 (unlabeled 2-trees).
Cf. A157904, A157905, A005195 (Euler transform = forests), A095133 (multisets).
Column 0 of A335362 and A034799.
Related to A005646; see A171871 and A171872.

Programs

  • Haskell
    import Data.List (generic_index)
    import Math.OEIS (getSequenceByID)
    triangle x = (x * x + x) `div` 2
    a000055 n = let {r = genericIndex (fromJust (getSequenceByID "A000081")); (m, nEO) = divMod n 2}
                in  r n - sum (zipWith (*) (map r [0..m]) (map r [n, n-1..]))
                    + (1-nEO) * (triangle (r m + 1))
    -- Walt Rorie-Baety, Jun 12 2021
    
  • Magma
    N := 30; P := PowerSeriesRing(Rationals(),N+1); f := func< A | x*&*[Exp(Evaluate(A,x^k)/k) : k in [1..N]]>; G := x; for i in [1..N] do G := f(G); end for; G000081 := G; G000055 := 1 + G - G^2/2 + Evaluate(G,x^2)/2; A000055 := Eltseq(G000055); // Geoff Baileu (geoff(AT)maths.usyd.edu.au), Nov 30 2009
    
  • Maple
    G000055 := series(1+G000081-G000081^2/2+subs(x=x^2,G000081)/2,x,31); A000055 := n->coeff(G000055,x,n); # where G000081 is g.f. for A000081 starting with n=1 term
    with(numtheory): b:= proc(n) option remember; `if`(n<=1, n, (add(add(d*b(d), d=divisors(j)) *b(n-j), j=1..n-1))/ (n-1)) end: a:= n-> `if`(n=0, 1, b(n) -(add(b(k) *b(n-k), k=0..n) -`if`(irem(n, 2)=0, b(n/2), 0))/2):
    seq(a(n), n=0..50);
    # Alois P. Heinz, Aug 21 2008
    # Program to create b-file b000055.txt:
    A000081 := proc(n) option remember; local d, j;
    if n <= 1 then n else
        add(add(d*procname(d),d=numtheory[divisors](j))*procname(n-j),j=1..n-1)/(n-1);
    fi end:
    A000055 := proc(nmax) local a81, n, t, a, j, i ;
    a81 := [seq(A000081(i), i=0..nmax)] ; a := [] ;
    for n from 0 to nmax do
        if n = 0 then
            t := 1+op(n+1, a81) ;
        else
            t := op(n+1, a81) ;
        fi;
        if type(n, even) then
            t := t-op(1+n/2, a81)^2/2 ;
            t := t+op(1+n/2, a81)/2 ;
        fi;
        for j from 0 to (n-1)/2 do
            t := t-op(j+1, a81)*op(n-j+1, a81) ;
        od:
        a := [op(a), t] ;
    od:
    a end:
    L := A000055(1000) ;
    #  R. J. Mathar, Mar 06 2009
  • Mathematica
    s[n_, k_] := s[n, k] = a[n + 1 - k] + If[n < 2k, 0, s[n - k, k]]; a[1] = 1; a[n_] := a[n] = Sum[a[i] s[n-1, i] i, {i, 1, n-1}] / (n-1); Table[a[i] - Sum[a[j] a[i-j], {j, 1, i/2}] + If[OddQ[i], 0, a[i/2] (a[i/2] + 1)/2], {i, 1, 50}] (* Robert A. Russell *)
    b[0] = 0; b[1] = 1; b[n_] := b[n] = Sum[d*b[d]*b[n-j], {j, 1, n-1}, {d, Divisors[j]}]/(n-1); a[0] = 1; a[n_] := b[n] - (Sum[b[k]*b[n-k], {k, 0, n}] - If[Mod[n, 2] == 0, b[n/2], 0])/2; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Apr 09 2014, after Alois P. Heinz *)
  • PARI
    {a(n) = local(A, A1, an, i, t); if( n<2, n>=0, an = Vec(A = A1 = 1 + O('x^n)); for(m=2, n, i=m\2; an[m] = sum(k=1, i, an[k] * an[m-k]) + (t = polcoeff( if( m%2, A *= (A1 - 'x^i)^-an[i], A), m-1))); t + if( n%2==0, binomial( -polcoeff(A, i-1), 2)))}; /* Michael Somos */
    
  • PARI
    N=66;  A=vector(N+1, j, 1);
    for (n=1, N, A[n+1] = 1/n * sum(k=1, n, sumdiv(k, d, d * A[d]) * A[n-k+1] ) );
    A000081=concat([0], A);
    H(t)=subst(Ser(A000081, 't), 't, t);
    x='x+O('x^N);
    Vec( 1 + H(x) - 1/2*( H(x)^2 - H(x^2) ) )
    \\ Joerg Arndt, Jul 10 2014
    
  • Python
    # uses function from A000081
    def A000055(n): return 1 if n == 0 else A000081(n)-sum(A000081(i)*A000081(n-i) for i in range(1,n//2+1)) + (0 if n % 2 else (A000081(n//2)+1)*A000081(n//2)//2) # Chai Wah Wu, Feb 03 2022
  • SageMath
    [len(list(graphs.trees(n))) for n in range(16)] # Peter Luschny, Mar 01 2020
    

Formula

G.f.: A(x) = 1 + T(x) - T^2(x)/2 + T(x^2)/2, where T(x) = x + x^2 + 2*x^3 + ... is the g.f. for A000081.
a(n) ~ A086308 * A051491^n * n^(-5/2). - Vaclav Kotesovec, Jan 04 2013
a(n) = A000081(n) - A217420(n+1), n > 0. - R. J. Mathar, Sep 19 2016
a(n) = A000676(n) + A000677(n). - R. J. Mathar, Aug 13 2018
a(n) = A000081(n) - (Sum_{1<=i<=j, i+j=n} A000081(i)*A000081(j)) + (1-(-1)^(n-1)) * binomial(A000081(n/2)+1,2) / 2 [Li, equation 4.2]. - Walt Rorie-Baety, Jul 05 2021

A000676 Number of centered trees with n nodes.

Original entry on oeis.org

1, 1, 0, 1, 1, 2, 3, 7, 12, 27, 55, 127, 284, 682, 1618, 3979, 9823, 24722, 62651, 160744, 415146, 1081107, 2831730, 7462542, 19764010, 52599053, 140580206, 377244482, 1016022191, 2745783463, 7443742141, 20239038700, 55178647926, 150820588425, 413226000775
Offset: 0

Views

Author

Keywords

Comments

A tree has either a center or a bicenter and either a centroid or a bicentroid. (These terms were introduced by Jordan.)
If the number of edges in a longest path in the tree is 2m, then the middle node in the path is the unique center, otherwise the two middle nodes in the path are the unique bicenters.
On the bottom of first page 266 of article Cayley (1881) is a table of A000676 and A000677 for n = 1..13. - Michael Somos, Aug 20 2018

Examples

			G.f. = 1 + x + x^3 + x^4 + 2*x^5 + 3*x^6 + 7*x^7 + 12*x^8 + 27*x^9 + 55*x^10 + ... - _Michael Somos_, Aug 20 2018
		

References

  • N. L. Biggs et al., Graph Theory 1736-1936, Oxford, 1976, p. 49.
  • F. Harary, Graph Theory, Addison-Wesley, Reading, MA, 1994; pp. 35, 36.
  • 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

Cf. A102911 (trees with a bicentroid), A027416 (trees with a centroid), A000677 (trees with a bicenter), A000055 (trees), A000081 (rooted trees).

Programs

  • Mathematica
    (* See link. *)

Formula

a(n) + A000677(n) = A000055(n).

A027416 Number of unlabeled (and unrooted) trees on n nodes having a centroid.

Original entry on oeis.org

1, 1, 0, 1, 1, 3, 3, 11, 13, 47, 61, 235, 341, 1301, 1983, 7741, 12650, 48629, 82826, 317955, 564225, 2144505, 3926353, 14828074, 27940136, 104636890, 201837109, 751065460, 1479817181, 5469566585, 10975442036, 40330829030, 82270184950
Offset: 0

Views

Author

Keywords

Comments

Also, number of rooted unlabeled trees on n nodes not having a primary branch.
A tree has either a center or a bicenter and either a centroid or a bicentroid. (These terms were introduced by Jordan.)
If the number of edges in a longest path in the tree is 2m, then the middle node in the path is the unique center, otherwise the two middle nodes in the path are the unique bicenters.
On the other hand, define the weight of a node P to be the greatest number of nodes in any subtree connected to P. Then either there is a unique node of minimal weight, the centroid of the tree, or there is a unique pair of minimal weight nodes, the bicentroids.
Let T be a tree with root node R. If R and the edges incident with it are deleted, the resulting rooted trees are called branches. A primary branch (there can be at most one) has i nodes where n/2 <= i <= n-1.

References

  • F. Harary, Graph Theory, Addison-Wesley, Reading, MA, 1994; pp. 35, 36.

Crossrefs

Cf. A102911 (trees with a bicentroid), A027415 (trees with a primary branch), A000676 (trees with a center), A000677 (trees with a bicenter), A000055 (trees), A000081 (rooted trees).

Programs

  • Maple
    N := 50: Y := [ 1,1 ]: for n from 3 to N do x*mul( (1-x^i)^(-Y[ i ]), i=1..n-1); series(%,x,n+1); b := coeff(%,x,n); Y := [ op(Y),b ]; od: P:=n->sum(Y[n-i]*Y[i],i=1..floor(n/2)): seq(Y[n]-P(n),n=1..35); # Emeric Deutsch, Nov 21 2004

Formula

a(n) = A000055(n) - A102911(n/2) if n is even, else a(n) = A000055(n).
a(n) = A000081(n) - A027415(n). - Emeric Deutsch, Nov 21 2004
a(n) = [x^n] 1 + x/Product_{i=1..ceiling(n/2)-1} (1-x^i)^A000081(i). See Cayley link above. - Geoffrey Critzer, Jul 30 2022

Extensions

More terms from Emeric Deutsch, Nov 21 2004
Entry revised (with new definition) by N. J. A. Sloane, Feb 26 2007

A102911 Number of unlabeled (and unrooted) trees on 2n nodes with a bicentroid.

Original entry on oeis.org

0, 1, 1, 3, 10, 45, 210, 1176, 6670, 41041, 258840, 1697403, 11359761, 77956341, 543625851, 3855429766, 27702225271, 201515674128, 1481195012220, 10991843660826, 82256068767106, 620288742329028, 4709854127998971, 35987845277616940, 276563426284762620
Offset: 0

Views

Author

N. J. A. Sloane and David Applegate, Feb 26 2007

Keywords

Comments

A tree has either a center or a bicenter and either a centroid or a bicentroid. (These terms were introduced by Jordan.)
If the number of edges in a longest path in the tree is 2m, then the middle node in the path is the unique center, otherwise the two middle nodes in the path are the unique bicenters.
On the other hand, define the weight of a node P to be the greatest number of nodes in any subtree connected to P. Then either there is a unique node of minimal weight, the centroid of the tree, or there is a unique pair of minimal weight nodes, the bicentroids.
A 2n-node tree with a bicentroid consists of two n-node rooted trees with the roots joined by an edge.

References

  • F. Harary, Graph Theory, Addison-Wesley, Reading, MA, 1994; pp. 35, 36.

Crossrefs

Cf. A027416 (trees with a centroid), A000676 (trees with a center), A000677 (trees with a bicenter), A000055 (trees), A000081 (rooted trees).

Formula

a(n) = r(n)*(r(n)+1)/2 where r(n) = A000081(n) is the number of rooted trees on n nodes.
Let f(n) = a(n/2) if n is even, = 0 otherwise. Then f(n) + A027416(n) = A000055(n).

A283826 Irregular triangle read by rows: T(n,k) = number of trees on n nodes with radius k, n>=1, 1 <= k <= floor(n/2).

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 7, 3, 1, 11, 10, 1, 1, 17, 25, 4, 1, 25, 61, 18, 1, 1, 36, 132, 61, 5, 1, 50, 277, 194, 28, 1, 1, 70, 554, 553, 117, 6, 1, 94, 1077, 1495, 451, 40, 1, 1, 127, 2034, 3823, 1552, 197, 7, 1, 168, 3770, 9427, 5020, 879, 54, 1, 1, 222, 6853, 22466, 15289, 3485, 305, 8, 1
Offset: 1

Views

Author

N. J. A. Sloane, Mar 19 2017

Keywords

Comments

The radius of a tree is the maximal distance of a node from the center.

Examples

			Triangle begins:
  0,
  1,
  1,
  1,  1,
  1,  2,
  1,  4,   1,
  1,  7,   3,
  1, 11,  10,   1,
  1, 17,  25,   4,
  1, 25,  61,  18,  1,
  1, 36, 132,  61,  5,
  1, 50, 277, 194, 28, 1,
  ...
		

Crossrefs

Cf. A283827.
See also A000676, A000677, A027416, A102911, A004250 (column 2?), A000055 (row sums).

Formula

T(n,k) = A034853(n,2k-1) + A034853(n,2k). - R. J. Mathar, Apr 03 2017

A355671 Number of labeled trees on [n] that are bicentered.

Original entry on oeis.org

0, 0, 1, 0, 12, 60, 570, 8190, 134456, 2408616, 49307670, 1159112130, 30619757652, 891045909468, 28244653953698, 969331283419590, 35858099428919280, 1423688804991442896, 60402176709135347502, 2726896792761748601226, 130498364319404393167820
Offset: 0

Views

Author

Geoffrey Critzer, Aug 02 2022

Keywords

Comments

This is the labeled version of A000677 where pertinent definitions can be found.

Crossrefs

Programs

  • Mathematica
    nn = 20; T = NestList[z Exp[#] &, z, nn]; G[k_, z_] := T[[k + 1]];
    H[k_, z_] := T[[k + 1]] - T[[k]];H[0, z_] := z; ReplacePart[ Sum[Range[0, nn]! CoefficientList[Series[H[m, z]^2/2, {z, 0, nn}], z], {m, 1, nn/2 - 1}], 3 -> 1]

Formula

a(n) = Sum_{odd d} A034854(n,d).
a(n) = A000272(n) - A356292(n).

A283827 Irregular triangle read by rows: T(n,k) = number of trees on n nodes with load k, n>=1, 1 <= k <= floor(n/2).

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 2, 1, 2, 3, 1, 3, 7, 1, 3, 9, 10, 1, 4, 12, 30, 1, 4, 18, 38, 45, 1, 5, 21, 64, 144, 1, 5, 27, 91, 217, 210
Offset: 1

Views

Author

N. J. A. Sloane, Mar 19 2017

Keywords

Comments

The load of a tree is the maximal branch weight from the centroid.

Examples

			Triangle begins:
  0,
  1,
  1,
  1, 1,
  1, 2,
  1, 2,  3,
  1, 3,  7,
  1, 3,  9, 10,
  1, 4, 12, 30,
  1, 4, 18, 38,  45,
  1, 5, 21, 64, 144,
  1, 5, 27, 91, 217, 210,
  ...
		

Crossrefs

Showing 1-8 of 8 results.