OFFSET
0,3
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..50
MATHEMATICA
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]];
seq[n_] := 1 + Sum[s = 0; Do[s += permcount[p]*2^edges[p]*x^k/Product[1 - x^p[[j]] + O[x]^(n-k+1), {j, 1, Length[p]}], {p, IntegerPartitions[k]}]; s/k!, {k, 1, n}] // CoefficientList[#, x]&;
seq[19] (* Jean-François Alcover, Jan 06 2021, 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)}
seq(n) = {Vec(1+sum(k=1, n, my(s=0); forpart(p=k, s+=permcount(p) * 2^edges(p) * x^k/prod(j=1, #p, 1 - x^p[j] + O(x^(n-k+1)))); s/k!))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Andrew Howroyd, Jan 01 2021
STATUS
approved