cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A321722 Number of non-normal magic squares whose entries are nonnegative integers summing to n.

This page as a plain text file.
%I A321722 #19 Jan 16 2019 19:42:28
%S A321722 1,1,1,1,10,21,97,657,5618,48918,494530,5383553,65112565,840566081,
%T A321722 11834555867,176621056393,2838064404989,48060623405313
%N A321722 Number of non-normal magic squares whose entries are nonnegative integers summing to n.
%C A321722 A non-normal magic square is a square matrix with row sums, column sums, and both diagonals all equal to d, for some d|n.
%H A321722 Wikipedia, <a href="https://en.wikipedia.org/wiki/Magic_square">Magic square</a>
%H A321722 <a href="/index/Mag#magic">Index entries for sequences related to magic squares</a>
%F A321722 a(p) = A007016(p) + 1 if p is prime. a(n) >= A007016(n) + 1 for n > 1. - _Chai Wah Wu_, Jan 15 2019
%e A321722 The a(4) = 10 magic squares:
%e A321722   [4]
%e A321722 .
%e A321722   [1 1]
%e A321722   [1 1]
%e A321722 .
%e A321722   [1 0 0 0][1 0 0 0][0 1 0 0][0 1 0 0][0 0 1 0][0 0 1 0][0 0 0 1][0 0 0 1]
%e A321722   [0 0 1 0][0 0 0 1][0 0 1 0][0 0 0 1][1 0 0 0][0 1 0 0][1 0 0 0][0 1 0 0]
%e A321722   [0 0 0 1][0 1 0 0][1 0 0 0][0 0 1 0][0 1 0 0][0 0 0 1][0 0 1 0][1 0 0 0]
%e A321722   [0 1 0 0][0 0 1 0][0 0 0 1][1 0 0 0][0 0 0 1][1 0 0 0][0 1 0 0][0 0 1 0]
%t A321722 prs2mat[prs_]:=Table[Count[prs,{i,j}],{i,Union[First/@prs]},{j,Union[Last/@prs]}];
%t A321722 multsubs[set_,k_]:=If[k==0,{{}},Join@@Table[Prepend[#,set[[i]]]&/@multsubs[Drop[set,i-1],k-1],{i,Length[set]}]];
%t A321722 Table[Length[Select[multsubs[Tuples[Range[n],2],n],And[Union[First/@#]==Range[Max@@First/@#]==Union[Last/@#],SameQ@@Join[{Tr[prs2mat[#]],Tr[Reverse[prs2mat[#]]]},Total/@prs2mat[#],Total/@Transpose[prs2mat[#]]]]&]],{n,5}]
%Y A321722 Cf. A006052, A007016, A120732, A271103, A319056, A319616.
%Y A321722 Cf. A321718, A321719, A321720, A321721.
%K A321722 nonn,more
%O A321722 0,5
%A A321722 _Gus Wiseman_, Nov 18 2018
%E A321722 a(7)-a(15) from _Chai Wah Wu_, Jan 15 2019
%E A321722 a(16)-a(17) from _Chai Wah Wu_, Jan 16 2019