OFFSET
0,3
COMMENTS
A non-normal semi-magic square is a nonnegative integer matrix with row sums and column sums all equal to d, for some d|n.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..180
Wikipedia, Magic square
FORMULA
a(p) = p! for p prime as the squares are all permutation matrices of order p and a(n) >= n! for n > 1 (see comments in A321717 and A321719). - Chai Wah Wu, Jan 13 2019
a(n) = Sum_{d|n, d<=n/d} A008300(n/d, d) for n > 0. - Andrew Howroyd, Apr 11 2020
MATHEMATICA
prs2mat[prs_]:=Table[Count[prs, {i, j}], {i, Union[First/@prs]}, {j, Union[Last/@prs]}];
Table[Length[Select[Subsets[Tuples[Range[n], 2], {n}], And[Union[First/@#]==Union[Last/@#]==Range[Max@@First/@#], SameQ@@Total/@prs2mat[#], SameQ@@Total/@Transpose[prs2mat[#]]]&]], {n, 5}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 18 2018
EXTENSIONS
a(7) from Chai Wah Wu, Jan 13 2019
a(8)-a(15) from Chai Wah Wu, Jan 14 2019
a(16)-a(21) from Chai Wah Wu, Jan 16 2019
Terms a(22) and beyond from Andrew Howroyd, Apr 11 2020
STATUS
approved