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.

A215852 Number of simple labeled graphs on n nodes with exactly 2 connected components that are trees or cycles.

This page as a plain text file.
%I A215852 #20 Apr 22 2021 08:48:00
%S A215852 1,3,19,135,1267,15029,218627,3783582,75956664,1734309929,44357222772,
%T A215852 1255715827483,38971877812380,1315634598619830,47994245894462576,
%U A215852 1881406032047006812,78870928008704884848,3520953336130828001295,166762291211479030734580
%N A215852 Number of simple labeled graphs on n nodes with exactly 2 connected components that are trees or cycles.
%H A215852 Alois P. Heinz, <a href="/A215852/b215852.txt">Table of n, a(n) for n = 2..145</a>
%F A215852 a(n) ~ c * n^(n-2), where c = 0.511564031298... . - _Vaclav Kotesovec_, Sep 07 2014
%e A215852 a(3) = 3:
%e A215852 .1 2.  .1-2.  .1 2.
%e A215852 .|. .  . . .  . / .
%e A215852 .3...  .3...  .3...
%p A215852 T:= proc(n, k) option remember; `if`(k<0 or k>n, 0,
%p A215852       `if`(n=0, 1, add(binomial(n-1, i)*T(n-1-i, k-1)*
%p A215852       `if`(i<2, 1, i!/2 +(i+1)^(i-1)), i=0..n-k)))
%p A215852     end:
%p A215852 a:= n-> T(n, 2):
%p A215852 seq(a(n), n=2..25);
%t A215852 T[n_, k_]:=T[n, k]=If[k<0 || k>n, 0, If[n==0, 1, Sum[Binomial[n - 1, i] T[n - 1 - i, k - 1] If[i<2, 1, i!/2 + (i + 1)^(i - 1)], {i, 0, n - k}]]]; Table[T[n, 2], {n, 2, 50}] (* _Indranil Ghosh_, Aug 07 2017, after Maple *)
%o A215852 (Python)
%o A215852 from sympy.core.cache import cacheit
%o A215852 from sympy import binomial, factorial as f
%o A215852 @cacheit
%o A215852 def T(n, k): return 0 if k<0 or k>n else 1 if n==0 else sum([binomial(n - 1, i)*T(n - 1 - i, k - 1)*(1 if i<2 else f(i)//2 + (i + 1)**(i - 1)) for i in range(n - k + 1)])
%o A215852 def a(n): return T(n , 2)
%o A215852 print([a(n) for n in range(2, 51)]) # _Indranil Ghosh_, Aug 07 2017, after maple code
%Y A215852 Column k=2 of A215861.
%Y A215852 The unlabeled version is A215982.
%K A215852 nonn
%O A215852 2,2
%A A215852 _Alois P. Heinz_, Aug 25 2012