OFFSET
0,3
COMMENTS
A coupled non-normal semi-magic rectangle is a nonnegative integer matrix with equal row sums and equal column sums. The common row sum may be different from the common column sum.
Rectangles must be of size k X m where k and m are divisors of n. This implies that a(p) = p! + 3 for p prime since the only allowable rectangles are of sizes 1 X 1, 1 X p, p X 1 and p X p. The 1 X 1 square is [p], the 1 X p and p X 1 rectangles are [1,...,1] and its transpose and the p X p squares are necessarily permutation matrices and there are p! permutation matrices of size p X p. Also, a(n) >= n! + 3 for n > 1. - Chai Wah Wu, Jan 15 2019
LINKS
Wikipedia, Magic square
FORMULA
a(p) = p! + 3 for p prime. a(n) >= n! + 3 for n > 1. - Chai Wah Wu, Jan 15 2019
EXAMPLE
The a(3) = 9 coupled semi-magic rectangles:
[3] [1 1 1]
.
[1] [1 0 0] [1 0 0] [0 1 0] [0 1 0] [0 0 1] [0 0 1]
[1] [0 1 0] [0 0 1] [1 0 0] [0 0 1] [1 0 0] [0 1 0]
[1] [0 0 1] [0 1 0] [0 0 1] [1 0 0] [0 1 0] [1 0 0]
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/@#], SameQ@@Total/@prs2mat[#], SameQ@@Total/@Transpose[prs2mat[#]]]&]], {n, 5}]
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Gus Wiseman, Nov 18 2018
EXTENSIONS
a(7)-a(15) from Chai Wah Wu, Jan 15 2019
a(16)-a(19) from Chai Wah Wu, Jan 16 2019
STATUS
approved