OFFSET
1,3
LINKS
Jean-François Alcover, Table of n, a(n) for n = 1..40
EXAMPLE
a(4)=10: The quadrangle with 1 choice of rooting. The star graph with 1 choice. The triangle with one protruding edge with 3 choices. The quadrangle with a diagonal with 2 choices. The tretrahedron graph with 1 choice. The linear tree with 2 choices (middle or end edge).
MATHEMATICA
nmax = 20;
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];
edges[v_] := (Sum[GCD[v[[i]], v[[j]]], {i, 2, Length@v}, {j, 1, i - 1}] + Total[Quotient[v, 2]]);
cross[u_, v_] := Sum[ GCD[u[[i]], v[[j]]], {i, 1, Length@u}, {j, 1, Length@v}];
a22[n_] := If[n < 2, 0, s = 0; Do[s += permcount[p]*(2^(edges[p])*(2^cross[{1, 1}, p] + 2^cross[{2}, p])), {p, IntegerPartitions[n - 2]}]; s/(2 (n - 2)!)];
a88[n_] := Module[{s = 0}, Do[s += permcount[p]*2^edges[p], {p, IntegerPartitions[n]}]; s/n!];
A[x_] = Sum[a22[n] x^n, {n, 0, nmax}] / Sum[a88[n] x^n, {n, 0, nmax}] + O[x]^nmax;
CoefficientList[A[x], x] // Rest (* Jean-François Alcover, Jul 07 2018, after Andrew Howroyd *)
PROG
(PARI)
permcount(v) = {my(m=1, s=0, k=0, t); for(i=1, #v, t=v[i]; k=if(i>1&&t==v[i-1], k+1, 1); m*=t*k; s+=t); s!/m}
edges(v) = {sum(i=2, #v, sum(j=1, i-1, gcd(v[i], v[j]))) + sum(i=1, #v, v[i]\2)}
cross(u, v) = {sum(i=1, #u, sum(j=1, #v, gcd(u[i], v[j])))}
gs(N, u) = {1+x*Ser(vector(N, n, my(s=0); forpart(p=n, s+=permcount(p)*(2^(edges(p)+cross(u, p)))); s/n!))}
seq(n)={concat([0], Vec((gs(n, [1, 1]) + gs(n, [2]))/(2*gs(n, []))))} \\ Andrew Howroyd, May 04 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
R. J. Mathar, May 01 2018
STATUS
approved