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

A055302 Triangle of number of labeled rooted trees with n nodes and k leaves, n >= 1, 1 <= k <= n.

Original entry on oeis.org

1, 2, 0, 6, 3, 0, 24, 36, 4, 0, 120, 360, 140, 5, 0, 720, 3600, 3000, 450, 6, 0, 5040, 37800, 54600, 18900, 1302, 7, 0, 40320, 423360, 940800, 588000, 101136, 3528, 8, 0, 362880, 5080320, 16087680, 15876000, 5143824, 486864, 9144, 9, 0, 3628800
Offset: 1

Views

Author

Christian G. Bower, May 11 2000

Keywords

Comments

Beginning with the second row, dividing each row by n gives the mirror of row n-1 of A141618. Under the exponential transform, the mirror of A141618 is generated, relating the number of connected graphs here to the number of disconnected graphs associated with A141618 (cf. A127671 and A036040). - Tom Copeland, Oct 25 2014

Examples

			Triangle begins
     1,
     2,     0;
     6,     3,     0;
    24,    36,     4,     0;
   120,   360,   140,     5,    0;
   720,  3600,  3000,   450,    6, 0;
  5040, 37800, 54600, 18900, 1302, 7, 0;
		

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 313.

Crossrefs

Row sums give A000169. Columns 1 through 12: A000142, A055303-A055313. Cf. A055314.
Cf. A248120 for a natural refinement.

Programs

  • Maple
    T:= (n, k)-> (n!/k!)*Stirling2(n-1, n-k):
    seq(seq(T(n, k), k=1..n), n=1..10);  # Alois P. Heinz, Nov 13 2013
  • Mathematica
    Table[Table[n!/k! StirlingS2[n-1,n-k], {k,1,n}], {n,0,10}]//Grid  (* Geoffrey Critzer, Dec 01 2012 *)
  • PARI
    A055302(n,k)=n!/k!*stirling(n-1, n-k,2);
    for(n=1,10,for(k=1,n,print1(A055302(n,k),", "));print());
    \\ Joerg Arndt, Oct 27 2014

Formula

E.g.f. (relative to x) satisfies: A(x,y) = xy + x*exp(A(x,y)) - x. Divides by n and shifts up under exponential transform.
T(n,k) = (n!/k!)*Stirling2(n-1, n-k). - Vladeta Jovovic, Jan 28 2004
T(n,k) = A055314(n,k)*(n-k) + A055314(n,k+1)*(k+1). The first term is the number of such trees with root degree > 1 while the second term is the number of such trees with root degree = 1. This simplifies to the above formula by Vladeta Jovovic. - Geoffrey Critzer, Dec 01 2012
E.g.f.: G(x,t) = log[1 + t * N(x*t,1/t)], where N(x,t) is the e.g.f. of A141618. Also, G(x*t,1/t)= log[1 + N(x,t)/t] is the comp. inverse in x of x / [1 + t * (e^x - 1)]. - Tom Copeland, Oct 26 2014

A055290 Triangle of trees with n nodes and k leaves, 2 <= k <= n.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 2, 2, 1, 0, 1, 3, 4, 2, 1, 0, 1, 4, 8, 6, 3, 1, 0, 1, 5, 14, 14, 9, 3, 1, 0, 1, 7, 23, 32, 26, 12, 4, 1, 0, 1, 8, 36, 64, 66, 39, 16, 4, 1, 0, 1, 10, 54, 123, 158, 119, 60, 20, 5, 1, 0, 1, 12, 78, 219, 350, 325, 202, 83, 25, 5, 1, 0
Offset: 2

Views

Author

Christian G. Bower, May 09 2000

Keywords

Examples

			Triangle begins:
  n=2:  1
  n=3:  1   0
  n=4:  1   1   0
  n=5:  1   1   1   0
  n=6:  1   2   2   1   0
  n=7:  1   3   4   2   1   0
  n=8:  1   4   8   6   3   1   0
  n=9:  1   5  14  14   9   3   1   0
  n=10: 1   7  23  32  26  12   4   1   0
  n=11: 1   8  36  64  66  39  16   4   1   0
  n=12: 1  10  54 123 158 119  60  20   5   1   0
  n=13: 1  12  78 219 350 325 202  83  25   5   1   0
		

References

  • F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973, p. 80, Problem 3.9.

Crossrefs

Row sums give A000055, row sums with weight k give A003228.
The labeled version is A055314.
Central column is A358107.
Left of central column is A359398.

Programs

  • PARI
    EulerMT(u)={my(n=#u, p=x*Ser(u), vars=variables(p)); Vec(exp( sum(i=1, n, substvec(p + O(x*x^(n\i)), vars, apply(v->v^i,vars))/i ))-1)}
    T(n)={my(u=[y]); for(n=2, n, u=concat([y], EulerMT(u))); my(r=x*Ser(u), v=Vec(r*(1-x+x*y) + (substvec(r,[x,y],[x^2,y^2]) - r^2)/2)); vector(n-1, k, Vecrev(v[1+k]/y^2, k))}
    { my(A=T(10)); for(n=1, #A, print(A[n])) }

Formula

G.f.: A(x, y)=(1-x+x*y)*B(x, y)+(1/2)*(B(x^2, y^2)-B(x, y)^2), where B(x, y) is g.f. of A055277.

A055897 a(n) = n*(n-1)^(n-1).

Original entry on oeis.org

1, 2, 12, 108, 1280, 18750, 326592, 6588344, 150994944, 3874204890, 110000000000, 3423740047332, 115909305827328, 4240251492291542, 166680102383370240, 7006302246093750000, 313594649253062377472, 14890324713954061755186, 747581753430634213933056
Offset: 1

Views

Author

Christian G. Bower, Jun 12 2000

Keywords

Comments

Total number of leaves in all labeled rooted trees with n nodes.
Number of endofunctions of [n] such that no element of [n-1] is fixed. E.g., a(3)=12: 123 -> 331, 332, 333, 311, 312, 313, 231, 232, 233, 211, 212, 213.
Number of functions f: {1, 2, ..., n} --> {1, 2, ..., n} such that f(1) != f(2), f(2) != f(3), ..., f(n-1) != f(n). - Warut Roonguthai, May 06 2006
Determinant of the n X n matrix ((2n, n^2, 0, ..., 0), (1, 2n, n^2, 0, ..., 0), (0, 1, 2n, n^2, 0, ..., 0), ..., (0, ..., 0, 1, 2n)). - Michel Lagneau, May 04 2010
For n > 1: a(n) = A240993(n-1) / A240993(n-2). - Reinhard Zumkeller, Aug 31 2014
Total number of points m such that f^(-1)(m) = {m}, (i.e., the preimage of m is the singleton set {m}) summed over all functions f:[n]->[n]. - Geoffrey Critzer, Jan 20 2022

Crossrefs

Programs

Formula

E.g.f.: x/(1-T), where T=T(x) is Euler's tree function (see A000169).
a(n) = Sum_{k=1..n} A055302(n, k)*k.
a(n) = the n-th term of the (n-1)-th binomial transform of {1, 1, 4, 18, 96, ..., (n-1)*(n-1)!, ...} (cf. A001563). - Paul D. Hanna, Nov 17 2003
a(n) = (n-1)^(n-1) + Sum_{i=2..n} (n-1)^(n-i)*binomial(n-1, i-1)*(i-1) *(i-1)!. - Paul D. Hanna, Nov 17 2003
a(n) = [x^(n-1)] 1/(1 - (n-1)*x)^2. - Paul D. Hanna, Dec 27 2012
a(n) ~ exp(-1) * n^n. - Vaclav Kotesovec, Nov 14 2014

Extensions

Additional comments from Vladeta Jovovic, Mar 31 2001 and Len Smiley, Dec 11 2001

A327369 Triangle read by rows where T(n,k) is the number of labeled simple graphs with n vertices and exactly k endpoints (vertices of degree 1).

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 2, 0, 6, 0, 15, 12, 30, 4, 3, 314, 320, 260, 80, 50, 0, 13757, 10890, 5445, 1860, 735, 66, 15, 1142968, 640836, 228564, 64680, 16800, 2772, 532, 0, 178281041, 68362504, 17288852, 3666600, 702030, 115416, 17892, 1016, 105
Offset: 0

Views

Author

Gus Wiseman, Sep 04 2019

Keywords

Examples

			Triangle begins:
      1
      1     0
      1     0     1
      2     0     6     0
     15    12    30     4     3
    314   320   260    80    50     0
  13757 10890  5445  1860   735    66    15
		

Crossrefs

Row sums are A006125.
Row sums without the first column are A245797.
Column k = 0 is A059167.
Column k = 1 is A277072.
Column k = 2 is A277073.
Column k = 3 is A277074.
Column k = n is A123023.
Column k = n - 1 is A327370.
The unlabeled version is A327371.
The covering version is A327377.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Subsets[Range[n],{2}]],Count[Length/@Split[Sort[Join@@#]],1]==k&]],{n,0,5},{k,0,n}]
  • PARI
    Row(n)={ \\ R, U, B are e.g.f. of A055302, A055314, A059167.
      my(R=sum(n=1, n, x^n*sum(k=1, n, stirling(n-1, n-k, 2)*y^k/k!)) + O(x*x^n));
      my(U=sum(n=2, n, x^n*sum(k=1, n, stirling(n-2, n-k, 2)*y^k/k!)) + O(x*x^n));
      my(B=x^2/2 + log(sum(k=0, n, 2^binomial(k, 2)*(x*exp(-x + O(x^n)))^k/k!)));
      my(A=exp(x + U + subst(B-x, x, x*(1-y) + R)));
      Vecrev(n!*polcoef(A, n), n + 1);
    }
    { for(n=0, 8, print(Row(n))) } \\ Andrew Howroyd, Oct 05 2019

Formula

Column-wise binomial transform of A327377.
E.g.f.: exp(x + U(x,y) + B(x*(1-y) + R(x,y))), where R(x,y) is the e.g.f. of A055302, U(x,y) is the e.g.f. of A055314 and B(x) + x is the e.g.f. of A059167. - Andrew Howroyd, Oct 05 2019

Extensions

Terms a(28) and beyond from Andrew Howroyd, Sep 09 2019

A055541 Total number of leaves (nodes of vertex degree 1) in all labeled trees with n nodes.

Original entry on oeis.org

0, 2, 6, 36, 320, 3750, 54432, 941192, 18874368, 430467210, 11000000000, 311249095212, 9659108818944, 326173191714734, 11905721598812160, 467086816406250000, 19599665578316398592, 875901453762003632658, 41532319635035234107392, 2082547005958224830656820
Offset: 1

Views

Author

Keywords

Comments

Equivalently, a(n) is the number of rooted labeled trees such that the root node has degree 1. - Geoffrey Critzer, Feb 07 2012

Crossrefs

Essentially the same as A061302.

Programs

  • Magma
    [0,2] cat [n*(n-1)^(n-2): n in [3..10]]; // G. C. Greubel, Nov 11 2017
  • Mathematica
    Join[{0,2}, Table[Sum[n!/k! StirlingS2[n-2,n-k] k, {k,2,n-1}], {n,3,20}]] (* Geoffrey Critzer, Nov 22 2011 *)
    Join[{0,2}, Table[n*(n-1)^(n-2), {n,3,50}]] (* or *) Rest[With[{nmax = 40}, CoefficientList[Series[-x*LambertW[-x], {x, 0, nmax}], x]*Range[0, nmax]!]] (* G. C. Greubel, Nov 11 2017 *)
  • PARI
    for(n=1, 30, print1(if(n==1, 0, if(n==2, 2, n*(n-1)^(n-2))), ", ")) \\ G. C. Greubel, Nov 11 2017
    

Formula

From Vladeta Jovovic, Mar 31 2001: (Start)
a(n) = n*(n-1)^(n-2), n > 1.
E.g.f.: -x*LambertW(-x). (End)
a(n) = Sum_{k=1..n} (A055314(n, k)*k). - Christian G. Bower, Jun 12 2000
E.g.f.: x*T(x) where T(x) is the e.g.f. for A000169. - Geoffrey Critzer, Feb 07 2012

Extensions

More terms from Christian G. Bower, Jun 12 2000

A327377 Triangle read by rows where T(n,k) is the number of labeled simple graphs covering n vertices with exactly k endpoints (vertices of degree 1).

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 1, 0, 3, 0, 10, 12, 12, 4, 3, 253, 260, 160, 60, 35, 0, 12068, 9150, 4230, 1440, 480, 66, 15, 1052793, 570906, 195048, 53200, 12600, 2310, 427, 0, 169505868, 63523656, 15600032, 3197040, 585620, 95088, 14056, 1016, 105
Offset: 0

Views

Author

Gus Wiseman, Sep 05 2019

Keywords

Comments

A graph is covering if there are no isolated vertices.

Examples

			Triangle begins:
      1
      0     0
      0     0     1
      1     0     3     0
     10    12    12     4     3
    253   260   160    60    35     0
  12068  9150  4230  1440   480    66    15
		

Crossrefs

Row sums are A006129.
Column k = 0 is A100743.
Column k = n is A123023.
Row sums without the first column are A327227.
The non-covering version is A327369.
The unlabeled version is A327372.

Programs

  • PARI
    Row(n)={ \\ R, U, B are e.g.f. of A055302, A055314, A059167.
      my(U=sum(n=2, n, x^n*sum(k=1, n, stirling(n-2, n-k, 2)*y^k/k!)) + O(x*x^n));
      my(R=sum(n=1, n, x^n*sum(k=1, n, stirling(n-1, n-k, 2)*y^k/k!)) + O(x*x^n));
      my(B=x^2/2 + log(sum(k=0, n, 2^binomial(k, 2)*(x*exp(-x + O(x^n)))^k/k!)));
      my(A=exp(-x + O(x*x^n))*exp(x + U + subst(B-x, x, x*(1-y) + R)));
      Vecrev(n!*polcoef(A, n), n + 1);
    }
    { for(n=0, 8, print(Row(n))) } \\ Andrew Howroyd, Oct 05 2019

Formula

Column-wise inverse binomial transform of A327369.
E.g.f.: exp(-x)*exp(x + U(x,y) + B(x*(1-y) + R(x,y))), where R(x,y) is the e.g.f. of A055302, U(x,y) is the e.g.f. of A055314 and B(x) + x is the e.g.f. of A059167. - Andrew Howroyd, Oct 05 2019

Extensions

Terms a(28) and beyond from Andrew Howroyd, Oct 05 2019

A358107 Number of unlabeled trees covering 2n nodes, n+1 of which are leaves.

Original entry on oeis.org

1, 1, 2, 6, 26, 119, 626, 3495, 20688, 127339, 810418, 5293790, 35351571, 240478715, 1662071181, 11646620758, 82601643511, 592110678762, 4284830131865, 31271691087861, 229980550743717, 1703097703162249, 12691879796699486, 95129358337729084, 716801612475691847
Offset: 1

Views

Author

Gus Wiseman, Dec 02 2022

Keywords

Crossrefs

Central column of A055290.
The labeled version is the central column of A055314.
For n leaves we have A359398.
A000272 counts trees, bisection A163395, unlabeled A000055.
A001187 counts connected graphs, unlabeled A001349.
A006125 counts graphs, unlabeled A000088.
A006129 counts covering graphs, unlabeled A002494.
A014068 counts graphs with n vertices and n-1 edges, unordered A001433.

Extensions

Terms a(11) and beyond from Andrew Howroyd, Jan 01 2023

A001258 Number of labeled n-node trees with unlabeled end-points.

Original entry on oeis.org

1, 1, 2, 6, 25, 135, 892, 6937, 61886, 621956, 6946471, 85302935, 1141820808, 16540534553, 257745010762, 4298050731298, 76356627952069, 1439506369337319, 28699241994332940, 603229325513240569, 13330768181611378558, 308967866671489907656, 7493481669479297191451, 189793402599733802743015, 5010686896406348299630712
Offset: 2

Views

Author

N. J. A. Sloane. More terms from N. J. A. Sloane, Jun 07 2012

Keywords

References

  • J.W. Moon, Counting Labelled Trees, Issue 1 of Canadian mathematical monographs, Canadian Mathematical Congress, 1970, Sec. 3.9.
  • 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. A151880.

Programs

  • Maple
    # This gives the sequence but without the initial 1:
    with(combinat);
    R:=proc(n,k) # this gives A055314
    if n=1 then if k=1 then RETURN(1) else RETURN(0); fi
        elif (n=2 and k=2) then RETURN(1)
        elif (n=2 and k>2) then RETURN(0)
        else stirling2(n-2,n-k)*n!/k!;
        fi;
    end;
    Rstar:=proc(n,k) # this gives A213262
    if k=2 then
         if n <=4 then RETURN(1); else RETURN((n-2)!/2); fi;
    else
       if k <= n-2 then add(binomial(n-i-1,k-i)*R(n-k,i), i=2..n-1);
       elif k=n-1 then 1;
       else 0;
       fi;
    fi;
    end;
    [seq(add(Rstar(n,k),k=2..n-1),n=3..20)];
  • Mathematica
    r[n_, k_] := Which[n == 1, If[k == 1, Return[1], Return[0]], n == 2 && k == 2, Return[1], n == 2 && k > 2, Return[0], n > k > 0, StirlingS2[n-2, n-k]*n!/k!, True, 0]; rstar[n_, k_] := Which[k == 2, If[n <= 4, Return[1], Return[(n-2)!/2]], k <= n-2, Sum[Binomial[n-i-1, k-i]*r[n-k, i], {i, 2, n-1}], k == n-1, 1, True, 0]; Join[{1}, Table[Sum[rstar[n, k], {k, 2, n-1}], {n, 3, 26}]] (* Jean-François Alcover, Oct 08 2012, translated from Maple *)
    tStar[2] = 1;
    tStar[n_] :=
      Sum[(-1)^j Binomial[n - k, j] Binomial[n - 1 - j,
         k] (n - k - j)^(n - k - 2), {k, 2, n - 1}, {j, 0, n - k - 1}];
    Table[tStar[n], {n, 2, 20}] (* David Callan, Jul 18 2014, after Moon reference *)

A219859 Triangular array read by rows: T(n,k) is the number of endofunctions, functions f:{1,2,...,n}->{1,2,...,n}, that have exactly k elements with no preimage; n>=0, 0<=k<=n.

Original entry on oeis.org

1, 1, 0, 2, 2, 0, 6, 18, 3, 0, 24, 144, 84, 4, 0, 120, 1200, 1500, 300, 5, 0, 720, 10800, 23400, 10800, 930, 6, 0, 5040, 105840, 352800, 294000, 63210, 2646, 7, 0, 40320, 1128960, 5362560, 7056000, 2857680, 324576, 7112, 8, 0, 362880, 13063680, 83825280, 160030080, 105099120, 23496480, 1524600, 18360, 9, 0
Offset: 0

Views

Author

Geoffrey Critzer, Dec 01 2012

Keywords

Comments

Equivalently, T(n,k) is the number of endofunctions whose functional digraph has exactly k leaves.
Equivalently, T(n,k) is the number of doubly rooted trees with k leaves. Here, a doubly rooted tree is a labeled tree in which two special vertices have been selected and the order of the selection matters. [Bona page 266]
Row sums are n^n.

Examples

			Triangle T(n,k) begins:
    1;
    1,     0;
    2,     2,     0;
    6,    18,     3,     0;
   24,   144,    84,     4,   0;
  120,  1200,  1500,   300,   5, 0;
  720, 10800, 23400, 10800, 930, 6, 0;
  ...
		

References

  • M. Bona, Introduction to Enumerative Combinatorics, McGraw Hill, 2007.

Crossrefs

Column k=0-1 give: A000142, A001804.
Row sums give A000312.
T(2n,n) gives A288312.

Programs

  • Mathematica
    Table[Table[n!/k!StirlingS2[n,n-k],{k,0,n}],{n,0,8}]//Grid
  • PARI
    row(n) = vector(n+1, k, k--; n!/k! * stirling(n,n-k,2)); \\ Michel Marcus, Jan 24 2022

Formula

T(n,k) = n!/k! * Stirling2(n,n-k).
T(n,0) = n!.
T(n,k) = A055302(n,k)*(n-k) + A055302(n,k+1)*(k+1). The first term (on rhs of this equation) is the number of such functions in which the preimage of f(n) contains more than one element. The second term is the number of such functions in which the preimage of f(n) contains exactly one element.
T(n,k) = binomial(n,k) Sum_{j=0..n-k}(-1)^j*binomial(n-k,j)*(n-k-j)^n. - Geoffrey Critzer, Aug 20 2013
E.g.f.: 1/(1 - (A(x,y) - y*x + x)) where A(x,y) is the e.g.f. for A055302. - Geoffrey Critzer, Jan 24 2022
From Alois P. Heinz, Jan 24 2022: (Start)
Sum_{k=0..n} k * T(n,k) = A209290(n).
Sum_{k=0..n} (-1)^k * T(n,k) = A344053(n). (End)

A358732 Number of labeled trees covering 2n nodes, half of which are leaves.

Original entry on oeis.org

0, 12, 720, 109200, 31752000, 15186346560, 10852244282880, 10851787634688000, 14481281691676800000, 24881574582258352358400, 53525038934303849706393600, 140958354488116955062668595200, 446153762528143389466306560000000, 1671353230826683972965623004979200000
Offset: 1

Views

Author

Gus Wiseman, Dec 01 2022

Keywords

Examples

			The a(2) = 12 trees:
  {{1,2},{1,3},{2,4}}
  {{1,2},{1,3},{3,4}}
  {{1,2},{1,4},{2,3}}
  {{1,2},{1,4},{3,4}}
  {{1,2},{2,3},{3,4}}
  {{1,2},{2,4},{3,4}}
  {{1,3},{1,4},{2,3}}
  {{1,3},{1,4},{2,4}}
  {{1,3},{2,3},{2,4}}
  {{1,3},{2,4},{3,4}}
  {{1,4},{2,3},{2,4}}
  {{1,4},{2,3},{3,4}}
		

Crossrefs

A central column of A055314.
The unlabeled rooted version is A185650.
The unlabeled version is A358107.
A000272 counts trees, bisection A163395.
A001187 counts connected graphs.
A006129 counts covering graphs.
A014068 counts graphs with n vertices and n-1 edges.

Programs

  • Mathematica
    a[n_]:=StirlingS2[2*n-2, n]*(2*n)!/n!; Array[a,14] (* Stefano Spezia, Aug 02 2024 *)
  • PARI
    a(n) = stirling(2*n-2, n, 2)*(2*n)!/n! \\ Andrew Howroyd, Dec 30 2022

Formula

a(n) = A055314(2*n, n) = Stirling2(2*n-2, n)*(2*n)!/n!. - Andrew Howroyd, Dec 30 2022

Extensions

Terms a(6) and beyond from Andrew Howroyd, Dec 30 2022
Showing 1-10 of 22 results. Next