OFFSET
0,2
COMMENTS
Similar to unlabeled tournaments (A000568), with the additional feature that each node carries either a plus sign or a minus sign.
Equivalence is defined with respect to the action of S_n on the nodes (and the induced action on the edges).
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..50 (terms n = 0..30 from N. J. A. Sloane)
FORMULA
a(n) = Sum_{j} (1/(Product (r^(j_r) (j_r)!))) * 2^{t_j},
where j runs through all partitions of n into odd parts, say with j_1 parts of size 1, j_3 parts of size 3, etc.,
and t_j = (1/2)*[ Sum_{r=1..n, s=1..n} j_r j_s gcd(r,s) + Sum_{r} j_r ].
MAPLE
with(combinat); with(numtheory);
for n from 1 to 30 do
p:=partition(n); s:=0:
for k from 1 to nops(p) do
# get next partition of n
ex:=1:
# discard if there is an even part
for i from 1 to nops(p[k]) do if p[k][i] mod 2=0 then ex:=0:break:fi: od:
# analyze an odd partition
if ex=1 then
# convert partition to list of sizes of parts
q:=convert(p[k], multiset);
for i from 1 to n do a(i):=0: od:
for i from 1 to nops(q) do a(q[i][1]):=q[i][2]: od:
# get number of parts
nump := add(a(i), i=1..n);
# get multiplicity
c:=1: for i from 1 to n do c:=c*a(i)!*i^a(i): od:
# get exponent t(j)
tj:=0;
for i from 1 to n do for j from 1 to n do
if a(i)>0 and a(j)>0 then tj:=tj+a(i)*a(j)*gcd(i, j); fi;
od: od:
s:=s + (1/c)*2^((tj+nump)/2);
fi:
od;
A[n]:=s;
od:
[seq(A[n], n=1..30)];
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]], 2], {i, 1, Length[v]}];
oddp[v_] := Module[{i}, For[i = 1, i <= Length[v], i++, If[BitAnd[v[[i]], 1] == 0, Return[0]]]; 1];
a[n_] := Module[{s = 0}, Do[If[oddp[p] == 1, s += permcount[p]*2^edges[p]* 2^Length[p]], {p, IntegerPartitions[n]}]; s/n!];
a /@ Range[0, 18] (* Jean-François Alcover, Jan 07 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)}
oddp(v) = {for(i=1, #v, if(bitand(v[i], 1)==0, return(0))); 1}
a(n) = {my(s=0); forpart(p=n, if(oddp(p), s+=permcount(p)*2^(#p+edges(p)))); s/n!} \\ Andrew Howroyd, Feb 29 2020
(Python)
from itertools import product
from math import prod, factorial, gcd
from fractions import Fraction
from sympy.utilities.iterables import partitions
def A093934(n): return int(sum(Fraction(1<<(sum(p[r]*p[s]*gcd(r, s) for r, s in product(p.keys(), repeat=2))+sum(p.values())>>1), prod(q**p[q]*factorial(p[q]) for q in p)) for p in partitions(n) if all(q&1 for q in p))) # Chai Wah Wu, Jul 01 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Nadia Heninger and N. J. A. Sloane, Jul 21 2009
STATUS
approved