|
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)];
|