OFFSET
0,2
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..50
G. Pfeiffer, Counting Transitive Relations, Journal of Integer Sequences, Vol. 7 (2004), Article 04.3.2.
FORMULA
Euler transform of A101460. - Andrew Howroyd, Oct 24 2019
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[Sum[GCD[v[[i]], v[[j]]], {j, 1, i - 1}], {i, 2, Length[v]}] + Sum[Quotient[v[[i]] - 1, 2], {i, 1, Length[v]}];
a[n_] := Module[{s = 0}, Do[s += permcount[p]*3^edges[p]*2^Length[p], {p, IntegerPartitions[n]}]; s/n!];
a /@ Range[0, 14] (* Jean-François Alcover, Jan 07 2021, after Andrew Howroyd *)
PROG
(GAP) f := function(n) local s, m, c, t, x, a, j; s := 0; m := [1..n]; c := Combinations(m, 2); t := Tuples(m, 2); for x in ConjugacyClasses(SymmetricGroup(n)) do a := Representative(x); j := Length(Cycles(a, m)); s := s+Size(x)*2^j*3^(Length(Cycles(a, t, OnPairs))-Length(Cycles(a, c, OnSets))-j); od; return s/Factorial(n); end;
(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]-1)\2)}
a(n) = {my(s=0); forpart(p=n, s+=permcount(p)*3^edges(p)*2^#p); s/n!} \\ Andrew Howroyd, Oct 24 2019
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Goetz Pfeiffer (Goetz.Pfeiffer(AT)nuigalway.ie), May 02 2003
STATUS
approved