[go: up one dir, main page]

login
Number of graphs with n nodes and n-1 edges.
(Formerly M2588 N1024)
9

%I M2588 N1024 #35 Aug 18 2022 10:21:39

%S 1,1,1,3,6,15,41,115,345,1103,3664,12763,46415,175652,691001,2821116,

%T 11932174,52211412,236007973,1100528508,5287050500,26134330813,

%U 132760735671,692294900849,3701754158688,20275893222445,113657560920970,651449039159673,3814790900995022,22805438484189851

%N Number of graphs with n nodes and n-1 edges.

%D J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 146.

%D N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H Sean A. Irvine, <a href="/A001433/b001433.txt">Table of n, a(n) for n = 1..40</a>

%H M. L. Stein and P. R. Stein, <a href="http://dx.doi.org/10.2172/4180737">Enumeration of Linear Graphs and Connected Linear Graphs up to p = 18 Points</a>. Report LA-3775, Los Alamos Scientific Laboratory of the University of California, Los Alamos, NM, Oct 1967

%t Needs["Combinatorica`"]

%t Table[ NumberOfGraphs[n, n-1], {n, 1, 25}] (* _Robert G. Wilson v_ *)

%t (* Second program (not needing Combinatorica): *)

%t permcount[v_] := Module[{m = 1, s = 0, k = 0, t}, For[i = 1, i <= Length[v], i++, t = v[[i]]; k = If[i > 1 && t == v[[i - 1]], k + 1, 1]; m *= t*k; s += t]; s!/m];

%t edges[v_, t_] := Product[Product[g = GCD[v[[i]], v[[j]]]; t[v[[i]]* v[[j]]/g]^g, {j, 1, i - 1}], {i, 2, Length[v]}]*Product[c = v[[i]]; t[c]^Quotient[c - 1, 2]*If[OddQ[c], 1, t[c/2]], {i, 1, Length[v]}];

%t a[n_] := a[n] = Module[{s = 0}, Do[s += permcount[p]*edges[p, 1 + x^# &], {p, IntegerPartitions[n]}]; s/n!] // Expand // SeriesCoefficient[#, {x, 0, n-1}]&;

%t Table[Print[n, " ", a[n]]; a[n], {n, 1, 35}] (* _Jean-François Alcover_, Aug 18 2022, after _Andrew Howroyd_ in A008406 *)

%Y Cf. A008406.

%K nonn,easy,nice

%O 1,4

%A _N. J. A. Sloane_

%E More terms from _Vladeta Jovovic_, Jan 15 2000