OFFSET
0,4
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = Sum_{k>=1} (k!*A000005(k) + (k+1)!*(A000005(k+1) - 2))*A008289(n,k) for n > 0. - Andrew Howroyd, Nov 17 2018
EXAMPLE
The a(5) = 9 matrices:
[5] [4 1] [3 2] [2 3] [1 4]
.
[4] [3] [2] [1]
[1] [2] [3] [4]
MATHEMATICA
prs2mat[prs_]:=Table[Count[prs, {i, j}], {i, Union[First/@prs]}, {j, Union[Last/@prs]}];
multsubs[set_, k_]:=If[k==0, {{}}, Join@@Table[Prepend[#, set[[i]]]&/@multsubs[Drop[set, i-1], k-1], {i, Length[set]}]];
Table[Length[Select[multsubs[Tuples[Range[n], 2], n], And[Union[First/@#]==Range[Max@@First/@#], Union[Last/@#]==Range[Max@@Last/@#], UnsameQ@@Join@@prs2mat[#]]&]], {n, 5}]
PROG
(PARI) seq(n)={my(B=vector((sqrtint(8*(n+1))+1)\2, n, if(n==1, 1, (n-1)!*numdiv(n-1) + n!*(numdiv(n) - 2)))); apply(p->sum(i=0, poldegree(p), B[i+1]*polcoef(p, i)), Vec(prod(k=1, n, 1 + x^k*y + O(x*x^n))))} \\ Andrew Howroyd, Nov 16 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 15 2018
EXTENSIONS
Terms a(11) and beyond from Andrew Howroyd, Nov 16 2018
STATUS
approved