login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of simple unlabeled graphs on n nodes with exactly 1 connected component that is a tree or a cycle.
4

%I #16 Jun 16 2018 12:51:19

%S 1,1,2,3,4,7,12,24,48,107,236,552,1302,3160,7742,19321,48630,123868,

%T 317956,823066,2144506,5623757,14828075,39299898,104636891,279793451,

%U 751065461,2023443033,5469566586,14830871803,40330829031,109972410222,300628862481

%N Number of simple unlabeled graphs on n nodes with exactly 1 connected component that is a tree or a cycle.

%H Alois P. Heinz, <a href="/A215981/b215981.txt">Table of n, a(n) for n = 1..700</a>

%F a(1) = a(2) = 1, a(n) = 1 + A000055(n) for n>=3.

%e a(5) = 4: .o-o-o. .o-o-o. .o-o-o. .o-o-o.

%e .| / . .| . .| | . . /| .

%e .o-o . .o-o . .o o . .o o .

%p with(numtheory):

%p b:= proc(n) option remember; local d, j; `if`(n<=1, n,

%p (add(add(d*b(d), d=divisors(j)) *b(n-j), j=1..n-1))/(n-1))

%p end:

%p a:= proc(n) option remember; local k; `if`(n>2, 1, 0)+ b(n)-

%p (add(b(k)*b(n-k), k=0..n) -`if`(irem(n, 2)=0, b(n/2), 0))/2

%p end:

%p seq(a(n), n=1..40);

%t 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 a[n_] := a[n] = If[n > 2, 1, 0] + b[n] - (Sum[b[k]*b[n - k], {k, 0, n}] - If[Mod[n, 2] == 0, b[n/2], 0])/2;

%t Array[a, 40] (* _Jean-François Alcover_, Mar 21 2017, translated from Maple *)

%Y Column k=1 of A215977.

%Y The labeled version is A215851.

%Y Cf. A000055, A215978.

%K nonn

%O 1,3

%A _Alois P. Heinz_, Aug 29 2012