A321654 Number of nonnegative integer matrices with sum of entries equal to n and no zero rows or columns, with distinct row sums and distinct column sums.
1, 1, 1, 13, 13, 45, 681, 885, 2805, 8301, 237213
Offset: 0
Examples
The a(3) = 13 matrices: [3] [2 1] [1 2] . [2] [2 0] [1 1] [1 1] [1] [1 0] [1 0] [0 2] [0 1] [0 1] [1] [0 1] [1 0] [0 1] [2] [1 1] [0 2] [1 0] [2 0] [1 1]
Crossrefs
Programs
-
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@@Total/@prs2mat[#],UnsameQ@@Total/@Transpose[prs2mat[#]]]&]],{n,5}]