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.

A321723 Number of non-normal magic squares whose entries are all 0 or 1 and sum to n.

This page as a plain text file.
%I A321723 #15 Jan 16 2019 19:42:07
%S A321723 1,1,0,0,9,20,96,656,5584,48913,494264,5383552,65103875,840566080,
%T A321723 11834159652,176621049784,2838040416201,48060623405312
%N A321723 Number of non-normal magic squares whose entries are all 0 or 1 and sum to n.
%C A321723 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 A321723 Wikipedia, <a href="https://en.wikipedia.org/wiki/Magic_square">Magic square</a>
%H A321723 <a href="/index/Mag#magic">Index entries for sequences related to magic squares</a>
%F A321723 a(n) >= A007016(n) with equality if n is prime. - _Chai Wah Wu_, Jan 15 2019
%e A321723 The a(4) = 9 magic squares:
%e A321723   [1 1]
%e A321723   [1 1]
%e A321723 .
%e A321723   [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 A321723   [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 A321723   [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 A321723   [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 A321723 prs2mat[prs_]:=Table[Count[prs,{i,j}],{i,Union[First/@prs]},{j,Union[Last/@prs]}];
%t A321723 multsubs[set_,k_]:=If[k==0,{{}},Join@@Table[Prepend[#,set[[i]]]&/@multsubs[Drop[set,i-1],k-1],{i,Length[set]}]];
%t A321723 Table[Length[Select[Subsets[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 A321723 Cf. A006052, A007016, A057151, A068313, A101370, A104602, A120732, A271103, A319056, A319616.
%Y A321723 Cf. A321717, A321718, A321719, A321720, A321721, A321722.
%K A321723 nonn,more
%O A321723 0,5
%A A321723 _Gus Wiseman_, Nov 18 2018
%E A321723 a(7)-a(15) from _Chai Wah Wu_, Jan 15 2019
%E A321723 a(16)-a(17) from _Chai Wah Wu_, Jan 16 2019