OFFSET
1,5
FORMULA
T(n,k) = T(k,k) for n > k.
EXAMPLE
Array begins:
===============================================
n\k| 1 2 3 4 5 6 7 8 9 10 11 12
---+-------------------------------------------
1 | 1 1 1 1 1 1 1 1 1 1 1 1 ...
2 | 1 2 3 5 6 8 10 13 15 18 21 25 ...
3 | 1 2 4 8 13 22 33 52 76 108 150 209 ...
4 | 1 2 4 9 16 32 57 105 178 301 490 793 ...
5 | 1 2 4 9 17 35 68 139 264 502 924 1695 ...
6 | 1 2 4 9 17 36 71 151 303 619 1234 2473 ...
7 | 1 2 4 9 17 36 72 154 315 661 1370 2885 ...
8 | 1 2 4 9 17 36 72 155 318 673 1413 3034 ...
9 | 1 2 4 9 17 36 72 155 319 676 1425 3078 ...
...
MATHEMATICA
permcount[v_List] := 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];
c[p_List, k_] := SeriesCoefficient[1/(Product[Product[(1 - x^(2*LCM[p[[i]], p[[j]] ]))^GCD[p[[i]], p[[j]]], {j, 1, i - 1}], {i, 2, Length[p]}]* Product[t = p[[i]]; (1 - x^t)^Mod[t, 2]*(1 - x^(2*t))^Quotient[t, 2], {i, 1, Length[p]}]), {x, 0, k}];
T[_, 1] = T[1, _] = 1; T[n_, k_] := (s = 0; Do[s += permcount[p]*c[p, k], {p, IntegerPartitions[n]}]; s/n!);
Table[T[n-k+1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Sep 13 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}
c(p, k)={polcoef(1/(prod(i=2, #p, prod(j=1, i-1, (1 - x^(2*lcm(p[i], p[j])) + O(x*x^k))^gcd(p[i], p[j]))) * prod(i=1, #p, my(t=p[i]); (1 - x^t + O(x*x^k))^(t%2)*(1 - x^(2*t) + O(x*x^k))^(t\2) )), k)}
T(n, k)={if(n==0, k==0, my(s=0); forpart(p=n, s+=permcount(p)*c(p, k)); s/n!)}
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Andrew Howroyd, Sep 03 2018
STATUS
approved