login
The number of connected subgraphs of the complete graph with n nodes.
1

%I #21 Sep 09 2023 06:54:35

%S 1,3,10,64,973,31743,2069970,267270040,68629753649,35171000942707,

%T 36024807353574290,73784587576805254664,302228602363365451957805,

%U 2475873310144021668263093215,40564787336902311168400640561098,1329227697997490307154018925966130320

%N The number of connected subgraphs of the complete graph with n nodes.

%C The problem originated from Attila Szabss.

%H G. C. Greubel, <a href="/A167939/b167939.txt">Table of n, a(n) for n = 1..80</a>

%F E.g.f.: exp(x)*log(A(x)) where A(x) is the e.g.f. for A006125. - _Geoffrey Critzer_, Nov 23 2016

%e For n = 3, consider the complete graph with nodes A, B and C. a(3) = 10, the 10 connected subgraphs being: A, B, C, AB, AC, BC, AB+AC, AB+BC, AC+BC, AB+AC+BC.

%t nn = 25;

%t g[z_]:= Sum[2^Binomial[n, 2] z^n/n!, {n, 0, nn}];

%t Drop[CoefficientList[Series[Exp[z]*Log[g[z]], {z,0,nn}], z]*Range[0, nn]!, 1] (* _Geoffrey Critzer_, Nov 23 2016 *)

%o (Haskell)

%o import Data.Function (fix)

%o import Data.List (transpose)

%o a :: [Integer]

%o a = scanl1 (+) . (!! 1) . transpose . fix $ map ((1:) . zipWith (*) (scanl1 (*) l) . zipWith poly (scanl1 (+) l)) . scanl (flip (:)) [] . zipWith (zipWith (*)) pascal where l = iterate (2*) 1

%o -- the Pascal triangle

%o pascal :: [[Integer]]

%o pascal = iterate (\l -> zipWith (+) (0: l) l) (1: repeat 0)

%o -- evaluate a polynomial at a given value

%o poly :: (Num a) => a -> [a] -> a

%o poly t = foldr (\e i -> e + t*i) 0

%o (Magma)

%o m:=35;

%o f:= func< x | (&+[2^Binomial(j,2)*x^j/Factorial(j): j in [0..m+2]]) >;

%o R<x>:=PowerSeriesRing(Rationals(), m);

%o Coefficients(R!(Laplace( Exp(x)*Log(f(x)) ))); // _G. C. Greubel_, Sep 08 2023

%o (SageMath)

%o m=35

%o def f(x): return sum(2^binomial(j,2)*x^j/factorial(j) for j in range(m+3))

%o def A167939_list(prec):

%o P.<x> = PowerSeriesRing(QQ, prec)

%o return P( exp(x)*log(f(x)) ).egf_to_ogf().list()

%o a=A167939_list(m); a[1:] # _G. C. Greubel_, Sep 08 2023

%Y Cf. A006125, A006896.

%K nonn

%O 1,2

%A Peter Divianszky (divip(AT)aszt.inf.elte.hu), Nov 15 2009