A321719 Number of non-normal semi-magic squares with sum of entries equal to n.
1, 1, 3, 7, 28, 121, 746, 5041, 40608, 362936, 3635017, 39916801, 479206146, 6227020801, 87187426839, 1307674521272, 20923334906117, 355687428096001, 6402415241245577, 121645100408832001, 2432905938909013343, 51090942176372298027, 1124001180562929946213
Offset: 0
Keywords
Examples
The a(3) = 7 semi-magic squares: [3] . [1 0 0] [1 0 0] [0 1 0] [0 1 0] [0 0 1] [0 0 1] [0 1 0] [0 0 1] [1 0 0] [0 0 1] [1 0 0] [0 1 0] [0 0 1] [0 1 0] [0 0 1] [1 0 0] [0 1 0] [1 0 0]
Links
- Andrew Howroyd, Table of n, a(n) for n = 0..100
- Wikipedia, Magic square
- Index entries for sequences related to magic squares
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/@#],SameQ@@Total/@prs2mat[#],SameQ@@Total/@Transpose[prs2mat[#]]]&]],{n,5}]
Formula
a(p) = p! + 1 for p prime and a(n) >= n! + 1 for n > 1 (see comment above). - Chai Wah Wu, Jan 13 2019
a(n) = Sum_{d|n} A257493(d, n/d) for n > 0. - Andrew Howroyd, Apr 11 2020
Extensions
a(7) from Chai Wah Wu, Jan 13 2019
a(6) corrected and a(8)-a(15) added by Chai Wah Wu, Jan 14 2019
a(16)-a(19) from Chai Wah Wu, Jan 16 2019
Terms a(20) and beyond from Andrew Howroyd, Apr 11 2020
Comments