A001858
Number of forests of trees on n labeled nodes.
Original entry on oeis.org
1, 1, 2, 7, 38, 291, 2932, 36961, 561948, 10026505, 205608536, 4767440679, 123373203208, 3525630110107, 110284283006640, 3748357699560961, 137557910094840848, 5421179050350334929, 228359487335194570528, 10239206473040881277575, 486909744862576654283616
Offset: 0
From _Gus Wiseman_, Apr 29 2024: (Start)
Edge-sets of the a(4) = 38 forests:
{} {12} {12,13} {12,13,14}
{13} {12,14} {12,13,24}
{14} {12,23} {12,13,34}
{23} {12,24} {12,14,23}
{24} {12,34} {12,14,34}
{34} {13,14} {12,23,24}
{13,23} {12,23,34}
{13,24} {12,24,34}
{13,34} {13,14,23}
{14,23} {13,14,24}
{14,24} {13,23,24}
{14,34} {13,23,34}
{23,24} {13,24,34}
{23,34} {14,23,24}
{24,34} {14,23,34}
{14,24,34}
(End)
- B. Bollobas, Modern Graph Theory, Springer, 1998, p. 290.
- 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).
- Alois P. Heinz, Table of n, a(n) for n = 0..388 (first 101 terms from T. D. Noe)
- J. E. Bartels, J. Mount, and D. J. A. Welsh, The polytope of win vectors. Annals of Combinatorics 1, 1-15 (1997). https://doi.org/10.1007/BF02558460
- David Callan, A Combinatorial Derivation of the Number of Labeled Forests, J. Integer Seqs., Vol. 6, 2003.
- Huantian Cao, AutoGF: An Automated System to Calculate Coefficients of Generating Functions, thesis, 2002.o
- Huantian Cao, AutoGF: An Automated System to Calculate Coefficients of Generating Functions, thesis, 2002.
- Huantian Cao, AutoGF: An Automated System to Calculate Coefficients of Generating Functions, thesis, 2002 [Local copy, with permission]
- P. Flajolet and R. Sedgewick, Analytic Combinatorics, 2009; see page 132.
- Samuele Giraudo, Combalgebraic structures on decorated cliques, Formal Power Series and Algebraic Combinatorics, Séminaire Lotharingien de Combinatoire, 78B.15, 2017, p. 7, arXiv:1709.08416 [math.CO], 2017.
- Anton Izosimov, Matrix polynomials, generalized Jacobians, and graphical zonotopes, arXiv:1506.05179 [math.AG], 2015.
- Qipeng Kuang, Ondřej Kuželka, Yuanhong Wang, and Yuyi Wang, Bridging Weighted First Order Model Counting and Graph Polynomials, arXiv:2407.11877 [cs.LO], 2024. See pp. 32-33.
- Arun P. Mani and Rebecca J. Stones, Congruences for weighted number of labeled forests, INTEGERS 16 (2016). #A17.
- J. Pitman, Coalescent Random Forests, J. Combin. Theory, A85 (1999), 165-193.
- J. Riordan, Forests of labeled trees, J. Combin. Theory, 5 (1968), 90-103.
- J. Riordan, Letter to N. J. A. Sloane, Oct 19 1970
- J. Riordan, Letter to N. J. A. Sloane, Nov 10 1975
- John Riordan and N. J. A. Sloane, Correspondence, 1974
- N. J. A. Sloane, Letter to J. Riordan, Nov. 1970
- R. Stanley, Decompositions of rational convex polytopes, Ann. Discrete Math 6.6 (1980): 333-342.
- L. Takacs, On the number of distinct forests, SIAM J. Discrete Math., 3 (1990), 574-581.
- E. M. Wright, A relationship between two sequences, Proc. London Math. Soc. (3) 17 (1967) 296-304.
- Index entries for sequences related to forests
A002807 counts cycles in a complete graph.
-
exp(x+x^2+add(n^(n-2)*x^n/n!, n=3..50));
# second Maple program:
a:= proc(n) option remember; `if`(n=0, 1, add(
binomial(n-1, j-1)*j^(j-2)*a(n-j), j=1..n))
end:
seq(a(n), n=0..20); # Alois P. Heinz, Sep 15 2008
# third Maple program:
F:= exp(-LambertW(-x)*(1+LambertW(-x)/2)):
S:= series(F,x,51):
seq(coeff(S,x,j)*j!, j=0..50); # Robert Israel, May 21 2015
-
nn=20;t=Sum[n^(n-1)x^n/n!,{n,1,nn}];Range[0,nn]!CoefficientList[ Series[Exp[t-t^2/2],{x,0,nn}],x] (* Geoffrey Critzer, Sep 05 2012 *)
nmax = 20; CoefficientList[Series[-LambertW[-x]/(x*E^(LambertW[-x]^2/2)), {x, 0, nmax}], x] * Range[0, nmax]! (* Vaclav Kotesovec, Jul 19 2019 *)
-
a(n)=if(n<0,0,sum(m=0,n,sum(j=0,m,binomial(m,j)*binomial(n-1,n-m-j)*n^(n-m-j)*(m+j)!/(-2)^j)/m!)) /* Michael Somos, Aug 22 2002 */
A105599
Triangle read by rows: T(n, m) = number of forests with n nodes and m labeled trees. Also number of forests with exactly n - m edges on n labeled nodes.
Original entry on oeis.org
1, 1, 1, 3, 3, 1, 16, 15, 6, 1, 125, 110, 45, 10, 1, 1296, 1080, 435, 105, 15, 1, 16807, 13377, 5250, 1295, 210, 21, 1, 262144, 200704, 76608, 18865, 3220, 378, 28, 1, 4782969, 3542940, 1316574, 320544, 55755, 7056, 630, 36, 1, 100000000, 72000000, 26100000, 6258000, 1092105, 143325, 14070, 990, 45, 1
Offset: 1
T(3, 2) = 3 because there are 3 such forests with 3 nodes and 2 trees.
Triangle begins:
1;
1, 1;
3, 3, 1;
16, 15, 6, 1;
125, 110, 45, 10, 1;
1296, 1080, 435, 105, 15, 1;
16807, 13377, 5250, 1295, 210, 21, 1;
- B. Bollobas, Graph Theory - An Introductory Course (Springer-Verlag, New York, 1979)
-
Flat(List([1..11],n->List([1..n],m->(1/Factorial(m)*Sum([0..m],j->(-1/2)^j*Binomial(m,j)*Binomial(n-1,m+j-1)*n^(n-m-j)*Factorial(m+j)))))); # Muniru A Asiru, Apr 01 2018
-
T:= proc(n,m) option remember;
if n<0 then 0
elif n=m then 1
elif m<1 or m>n then 0
else add(binomial(n-1,j-1)*j^(j-2)*T(n-j,m-1), j=1..n-m+1)
fi
end:
seq(seq(T(n, m), m=1..n), n=1..12); # Alois P. Heinz, Sep 10 2008
# The function BellMatrix is defined in A264428.
# Adds (1,0,0,0, ..) as column 0.
BellMatrix(n -> (n+1)^(n-1), 9); # Peter Luschny, Jan 27 2016
-
f[list_]:=Select[list,#>0&];Flatten[Map[f, Transpose[Table[t = Sum[n^(n - 2) x^n/n!, {n, 1, 20}];Drop[Range[0, 8]! CoefficientList[Series[t^k/k!, {x, 0, 8}], x],1], {k, 1, 8}]]]] (* Geoffrey Critzer, Nov 22 2011 *)
T[n_, m_] := Sum[(-1/2)^j*Binomial[m, j]*Binomial[n-1, m+j-1]*n^(n-m-j)*(m + j)!, {j, 0, m}]/m!; Table[T[n, m], {n, 1, 10}, {m, 1, n}] // Flatten (* Jean-François Alcover, Jan 09 2016, after Max Alekseyev *)
rows = 10;
t = Table[(n+1)^(n-1), {n, 0, rows}];
T[n_, k_] := BellY[n, k, t];
Table[T[n, k], {n, 1, rows}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jun 22 2018, after Peter Luschny *)
-
{ T(n,m) = sum(j=0,m, (-1/2)^j * binomial(m,j) * binomial(n-1,m+j-1) * n^(n-m-j)* (m+j)! )/m! } /* Max Alekseyev, Oct 08 2014 */
A302112
Number of forests with 2n nodes and n labeled trees. Also number of forests with exactly n edges on 2n labeled nodes.
Original entry on oeis.org
1, 1, 15, 435, 18865, 1092105, 79170399, 6899167275, 702495121185, 81857181636945, 10742799174110575, 1568060617808784099, 251983549987815976785, 44207398164005846558425, 8407483858740005340602175, 1722961754698440157865926875, 378507890849998531093971032385
Offset: 0
-
T:= proc(n, m) option remember; `if`(n<0, 0, `if`(n=m, 1,
`if`(m<1 or m>n, 0, add(binomial(n-1, j-1)*j^(j-2)*
T(n-j, m-1), j=1..n-m+1))))
end:
a:= n-> T(2*n, n):
seq(a(n), n=0..20);
-
Flatten[{1, Table[Sum[(-1)^k * Binomial[n, k] * Binomial[2*n - 1, n - k] * 2^(n - 2*k) * n^(n - k) * (n + k)!, {k, 0, n} ] / n!, {n, 1, 20}]}] (* Vaclav Kotesovec, Jul 19 2019 *)
Table[(-1)^n * HypergeometricPFQ[{1 - 2*n, -n}, {1, -2*n}, 4*n] * (2*n)! / (n!*2^n), {n, 0, 20}] (* Vaclav Kotesovec, Jul 19 2019 *)
Table[(-1)^n * 2^n * Gamma[n + 1/2] * (2*n*Hypergeometric1F1[1 - n, 2, 4*n] + LaguerreL[n, 4*n]) / Sqrt[Pi], {n, 0, 20}] (* Vaclav Kotesovec, Feb 19 2020 *)
A083483
Number of forests with two connected components in the complete graph K_{n}.
Original entry on oeis.org
0, 1, 3, 15, 110, 1080, 13377, 200704, 3542940, 72000000, 1656409535, 42568187904, 1208912928522, 37603105146880, 1271514111328125, 46443371157258240, 1822442358054692408, 76461926986744528896, 3415753581721829617275
Offset: 1
Woong Kook (andrewk(AT)math.uri.edu), Jun 08 2003
- W. Kook, Categories of acyclic graphs and automorphisms of free groups, Ph.D. thesis (G. Carlsson, advisor), Stanford University, 1996.
- Vincenzo Librandi, Table of n, a(n) for n = 1..200
- N. Eaton, W. Kook, and L. Thoma, Monotonicity for complete graphs, preprint
- A. Kassel, R. Kenyon, and W. Wu, Random two-component spanning forests, Ann. Inst. H. Poincaré Probab. Statist., 51 (2015), 1457-1464.
- C. J. Liu and Yutze Chow, On operator and formal sum methods for graph enumeration problems, SIAM J. Algebraic Discrete Methods, 5 (1984), no. 3, 384--406. MR0752043 (86d:05059). See Eq. (47). - From _N. J. A. Sloane_, Apr 09 2014
-
[n^(n-4)*(n-1)*(n+6)/2 : n in [1..20]]; // Vincenzo Librandi, Apr 10 2014
-
f:=n->(n-1)!*n^(n-4)*(n+6)/(2*(n-2)!); [seq(f(n),n=2..30)]; # N. J. A. Sloane, Apr 09 2014
-
(* first 20 terms starting with n=1 *) T := Sum[i^(i - 2)*(x^i)/i!, {i, 1, 20}]; T2 := Expand[(T^{2})/2! ]; C2[i_] := Coefficient[T2, x^{i}]*i!; M := MatrixForm[Table[C2[i], {i, 20}]]; M
Table[n^(n - 4) (n - 1) (n + 6)/2, {n, 1, 40}] (* Vincenzo Librandi, Apr 10 2014 *)
-
for(n=1,30, print1(n^(n-4)*(n-1)*(n+6)/2, ", ")) \\ G. C. Greubel, Nov 14 2017
A136605
Triangle read by rows: T(n,k) = number of forests on n unlabeled nodes with k edges (n>=1, 0<=k<=n-1).
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 3, 3, 1, 1, 2, 4, 6, 6, 1, 1, 2, 4, 7, 11, 11, 1, 1, 2, 4, 8, 14, 23, 23, 1, 1, 2, 4, 8, 15, 29, 46, 47, 1, 1, 2, 4, 8, 16, 32, 60, 99, 106, 1, 1, 2, 4, 8, 16, 33, 66, 128, 216, 235, 1, 1, 2, 4, 8, 16, 34, 69, 143, 284, 488, 551, 1, 1, 2, 4, 8, 16, 34, 70, 149, 315, 636, 1121, 1301
Offset: 1
Triangle begins:
1
1,1
1,1,1
1,1,2,2
1,1,2,3,3
1,1,2,4,6,6 <- T(6,3) = 4 forests on 6 nodes with 3 edges.
1,1,2,4,7,11,11
1,1,2,4,8,14,23,23
1,1,2,4,8,15,29,46,47
1,1,2,4,8,16,32,60,99,106
1,1,2,4,8,16,33,66,128,216,235
1,1,2,4,8,16,34,69,143,284,488,551
1,1,2,4,8,16,34,70,149,315,636,1121,1301
1,1,2,4,8,16,34,71,152,330,710,1467,2644,3159
- F. Harary and E. M. Palmer, Graphical Enumeration, Academic Press, NY, 1973, pp. 58-59.
-
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:
t:= 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):
g:= proc(n, i) option remember; `if`(n=0, 1,
`if`(i<1, 0, expand(add(binomial(t(i)+j-1, j)*
g(n-i*j, i-1)*x^j, j=0..n/i))))
end:
T:= n-> (p-> seq(coeff(p, x, n-i), i=0..n-1))(g(n$2)):
seq(T(n), n=1..14); # Alois P. Heinz, Apr 11 2014
-
b[n_] := b[n] = If[n <= 1, n, (Sum[Sum[d*b[d], {d, Divisors[j]}]*b[n-j], {j, 1, n-1}])/(n-1)]; t[n_] := If[n == 0, 1, b[n] - (Sum[b[k]*b[n-k], {k, 0, n}] - If[Mod[n, 2] == 0, b[n/2], 0])/2]; g[n_, i_] := g[n, i] = If[n == 0, 1, If[i < 1, 0, Expand[Sum[Binomial[t[i] + j - 1, j]*g[n - i*j, i-1]*x^j, {j, 0, n/i}]]]]; T[n_] := CoefficientList[g[n, n], x] // Reverse // Most; Table[T[n], {n, 1, 14}] // Flatten (* Jean-François Alcover, Apr 16 2014, after Alois P. Heinz *)
A362968
Number of integral points in 2 * permutohedron of order n.
Original entry on oeis.org
1, 3, 19, 201, 3081, 62683, 1598955, 49180113, 1773405649, 73410669171, 3432267261699, 178922825114905, 10291053760222041, 647436905815864011, 44229766376059342171, 3260749830852693615777, 258039101519624535653025
Offset: 1
-
w := LambertW(-2*x): egf := exp(-w * (2 + w) / 4): ser := series(egf, x, 20):
seq(n! * coeff(ser, x, n), n = 1..17); # Peter Luschny, Jun 19 2023
-
a362968(n) = my(x=y+O(y^(n+1))); n! * polcoef( exp(-lambertw(-2*x)/2 - lambertw(-2*x)^2/4), n );
A239910
Number of forests with three connected components in the complete graph K_{n}.
Original entry on oeis.org
0, 0, 1, 6, 45, 435, 5250, 76608, 1316574, 26100000, 587030895, 14780620800, 412069511139, 12604714327296, 419801484375000, 15123782440058880, 586049426860524300, 24307340986526810112, 1074495780444130114509, 50429952000000000000000
Offset: 1
-
[(n-1)*(n-2)*n^(n-6)*(n^2+13*n+60)/8: n in [1..20]]; // Vincenzo Librandi, Apr 10 2014
-
f := n-> (n-1)*(n-2)*n^(n-6)*(n^2+13*n+60)/8; [seq(f(n),n=3..20)];
-
Table[(n-1)*(n-2) * n^(n - 6) * (n^2 + 13 n + 60)/8, {n, 1, 20}] (* Vincenzo Librandi, Apr 10 2014, simplified by Vaclav Kotesovec, Feb 20 2020 *)
A144164
Number of simple graphs on n labeled nodes, where each maximally connected subgraph is either a tree or a cycle, also row sums of A144163, A215861.
Original entry on oeis.org
1, 1, 2, 8, 45, 338, 3304, 40485, 602075, 10576466, 214622874, 4941785261, 127282939615, 3625467047196, 113140481638088, 3838679644895477, 140681280613912089, 5538276165405744140, 233086092164091031114, 10443453353262112373541, 496313160155209940833001
Offset: 0
a(3) = 8, because there are 8 simple graphs on 3 labeled nodes, where each maximally connected subgraph is either a tree or a cycle, with edge-counts 0(1), 1(3), 2(3), 3(1):
.1.2. .1-2. .1.2. .1.2. .1-2. .1.2. .1-2. .1-2.
..... ..... ../.. .|... ../.. .|/.. .|... .|/..
.3... .3... .3... .3... .3... .3... .3... .3...
-
f:= proc(n,k) option remember; local j; if k=0 then 1 elif k<0 or n<=k then 0 elif k=n-1 then n^(n-2) else add(binomial(n-1,j) *f(j+1,j) *f(n-1-j,k-j), j=0..k) fi end:
c:= proc(n,k) option remember; local i,j; if k=0 then 1 elif k<0 or n add(T(n,k), k=0..n):
seq(a(n), n=0..25);
-
f[n_, k_] := f[n, k] = Module[{j}, Which[k == 0, 1, k<0 || n <= k, 0, k == n-1, n^(n-2), True, Sum[Binomial[n-1, j]*f[j+1, j]*f[n-1-j, k-j], {j, 0, k}]]]; c[n_, k_] := c[n, k] = Module[{i, j}, If[k == 0, 1, If[k<0 || nJean-François Alcover, Mar 05 2014, after Alois P. Heinz *)
-
from sympy.core.cache import cacheit
from sympy import binomial, prod
@cacheit
def f(n, k): return 1 if k==0 else 0 if k<0 or n<=k else n**(n - 2) if k == n - 1 else sum(binomial(n - 1, j)*f(j + 1, j)*f(n - 1 - j, k - j) for j in range(k + 1))
@cacheit
def c(n, k): return 1 if k==0 else 0 if k<0 or nIndranil Ghosh, Aug 07 2017
A144163
Triangle T(n,k), n>=0, 0<=k<=n, read by rows: T(n,k) = number of simple graphs on n labeled nodes with k edges where each maximally connected subgraph is either a tree or a cycle.
Original entry on oeis.org
1, 1, 0, 1, 1, 0, 1, 3, 3, 1, 1, 6, 15, 20, 3, 1, 10, 45, 120, 150, 12, 1, 15, 105, 455, 1185, 1473, 70, 1, 21, 210, 1330, 5565, 14469, 18424, 465, 1, 28, 378, 3276, 19635, 81060, 213990, 280200, 3507, 1, 36, 630, 7140, 57393, 334656, 1385076, 3732300, 5029218, 30016
Offset: 0
T(4,3) = 20, because there are 20 simple graphs on 4 labeled nodes with 3 edges, where each maximally connected subgraph is either a tree or a cycle, 16 of these graphs consist of a single tree with 4 nodes and 4 consist of a cycle with 3 and a tree with 1 node:
.1-2. .1-2. .1.2. .1.2. .1-2. .1-2. .1-2. .1-2. .1-2. .1.2.
.|\.. ../|. ..\|. .|/.. .|... ...|. ../.. ..\.. .|.|. .|.|.
.4.3. .4.3. .4-3. .4-3. .4-3. .4-3. .4-3. .4-3. .4.3. .4-3.
.
.1.2. .1.2. .1-2. .1.2. .1.2. .1.2. .1.2. .1.2. .1-2. .1-2.
.|/|. .|\|. ..X.. ..X|. ..X.. .|X.. ../|. .|\.. .|/.. ..\|.
.4.3. .4.3. .4.3. .4.3. .4-3. .4.3. .4-3. .4-3. .4.3. .4.3.
Triangle begins:
1;
1, 0;
1, 1, 0;
1, 3, 3, 1;
1, 6, 15, 20, 3;
1, 10, 45, 120, 150, 12;
-
f:= proc(n,k) option remember; local j; if k=0 then 1 elif k<0 or n<=k then 0 elif k=n-1 then n^(n-2) else add(binomial(n-1,j) *f(j+1,j) *f(n-1-j,k-j), j=0..k) fi end:
c:= proc(n,k) option remember; local i,j; if k=0 then 1 elif k<0 or n
-
f[n_, k_] := f[n, k] = Which[k == 0, 1, k<0 || n <= k, 0, k == n-1, n^(n-2), True, Sum[Binomial[n-1, j]*f[j+1, j]*f[n-1-j, k-j], {j, 0, k}]]; c[n_, k_] := c[n, k] = Which[k == 0, 1 , k<0 || nJean-François Alcover, Jan 21 2014, translated from Alois P. Heinz's Maple code *)
A240681
Number of forests with n labeled nodes and 4 trees.
Original entry on oeis.org
1, 10, 105, 1295, 18865, 320544, 6258000, 138437310, 3428282880, 94059655690, 2833936641536, 93055995703125, 3308477732618240, 126642365068676240, 5193315990469140480, 227160198500847385884, 10557603840000000000000, 519578655591970045435770
Offset: 4
-
T:= proc(n, m) option remember; `if`(n<0, 0, `if`(n=m, 1,
`if`(m<1 or m>n, 0, add(binomial(n-1, j-1)*j^(j-2)*
T(n-j, m-1), j=1..n-m+1))))
end:
a:= n-> T(n, 4):
seq(a(n), n=4..30);
-
Table[n^(n-8) * (n-3)*(n-2)*(n-1)*(n^3 + 21*n^2 + 202*n + 840)/48,{n,4,20}] (* Vaclav Kotesovec, Sep 06 2014 *)
Showing 1-10 of 21 results.
Comments