login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A321660
Number of nonnegative integer matrices with sum of entries equal to n and no zero rows or columns, whose entries are all distinct.
5
1, 1, 1, 5, 5, 9, 45, 49, 85, 125, 233, 273, 417, 529, 745, 2573, 2861, 4761, 6837, 10489, 14317, 22637, 28289, 40041, 52041, 70177, 88561, 117605, 234773, 274761, 407469, 553681, 792613, 1052525, 1493033, 1959009, 3135537, 3904129, 5475673, 7173725, 9853325
OFFSET
0,4
LINKS
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
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 15 2018
EXTENSIONS
Terms a(11) and beyond from Andrew Howroyd, Nov 16 2018
STATUS
approved