A006052
Number of magic squares of order n composed of the numbers from 1 to n^2, counted up to rotations and reflections.
Original entry on oeis.org
1, 0, 1, 880, 275305224, 17753889197660635632
Offset: 1
An illustration of the unique (up to rotations and reflections) magic square of order 3:
+---+---+---+
| 2 | 7 | 6 |
+---+---+---+
| 9 | 5 | 1 |
+---+---+---+
| 4 | 3 | 8 |
+---+---+---+
- E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Vol. II, pp. 778-783 gives the 880 4 X 4 squares.
- M. Gardner, Mathematical Games, Sci. Amer. Vol. 249 (No. 1, 1976), p. 118.
- M. Gardner, Time Travel and Other Mathematical Bewilderments. Freeman, NY, 1988, p. 216.
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- Ian Cameron, Adam Rogers and Peter Loly, "The Library of Magical Squares" -- a summary of the main results for the Shannon entropy of magic and Latin squares: isentropic clans and indexing, in celebration of George Styan's 75th.
- Bernard Frénicle de Bessy, Des carrez ou tables magiques, Divers ouvrages de mathématique et de physique (1693), pp. 423-483.
- Bernard Frénicle de Bessy, Table générale des carrez de quatre, Divers ouvrages de mathématique et de physique (1693), pp. 484-503.
- Skylar R. Croy, Jeremy A. Hansen, and Daniel J. McQuillan, Calculating the Number of Order-6 Magic Squares with Modular Lifting, Proceedings of the Ninth International Symposium on Combinatorial Search (SoCS 2016).
- Mahadi Hasan and Md. Masbaul Alam Polash, An Efficient Constraint-Based Local Search for Maximizing Water Retention on Magic Squares, Emerging Trends in Electrical, Communications, and Information Technologies, Lecture Notes in Electrical Engineering book series (LNEE 2019) Vol. 569, 71-79.
- Hidetoshi Mino, The number of magic squares of order 6.
- Hidetoshi Mino, Fast enumeration of magic squares, YouTube video, 2025.
- I. Peterson, Magic Tesseracts.
- K. Pinn and C. Wieczerkowski, Number of magic squares from parallel tempering Monte Carlo, arXiv:cond-mat/9804109 [cond-mat.stat-mech], 1998; Internat. J. Modern Phys., 9 (4) (1998) 541-546.
- Tyler Pringle, Magic Squares and Using Magic Series for Theory, The College of William and Mary (2024). See pp. 6, 9.
- Artem Ripatti, On the number of semi-magic squares of order 6, arXiv:1807.02983 [math.CO], 2018. See Table 1 p. 2.
- R. Schroeppel, Emails to N. J. A. Sloane, Jun. 1991.
- N. J. A. Sloane & J. R. Hendricks, Correspondence, 1974.
- Walter Trump, How many magic squares are there? - Results of historical and computer enumeration.
- Eric Weisstein's World of Mathematics, Magic Square.
- Index entries for sequences related to magic squares
A321719
Number of non-normal semi-magic squares with sum of entries equal to n.
Original entry on oeis.org
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
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]
-
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}]
a(6) corrected and a(8)-a(15) added by
Chai Wah Wu, Jan 14 2019
A321717
Number of non-normal (0,1) semi-magic rectangles with sum of all entries equal to n.
Original entry on oeis.org
1, 1, 4, 8, 39, 122, 950, 5042, 45594, 366243, 3858148, 39916802, 494852628, 6227020802, 88543569808, 1308012219556, 21086562956045, 355687428096002, 6427672041650478, 121645100408832002, 2437655776358606198, 51091307191310604724, 1125098543553717372868, 25852016738884976640002, 620752122372339473623314, 15511210044577707470250243
Offset: 0
The a(3) = 8 semi-magic rectangles:
[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]
-
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[Subsets[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}]
A321718
Number of coupled non-normal semi-magic rectangles with sum of entries equal to n.
Original entry on oeis.org
1, 1, 5, 9, 44, 123, 986, 5043, 45832, 366300, 3862429, 39916803, 495023832, 6227020803, 88549595295, 1308012377572, 21086922542349, 355687428096003, 6427700493998229, 121645100408832003, 2437658338007783347, 51091307195905020227, 1125098837523651728389, 25852016738884976640003, 620752163206546966698620, 15511210044577707492319496
Offset: 0
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]
-
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}]
A321721
Number of non-isomorphic non-normal semi-magic square multiset partitions of weight n.
Original entry on oeis.org
1, 1, 2, 2, 4, 2, 7, 2, 10, 7, 12, 2, 38, 2, 21, 46, 72, 2, 162, 2, 420, 415, 64, 2, 4987, 1858, 110, 9336, 45456, 2, 136018, 2, 1014658, 406578, 308, 3996977, 34937078, 2, 502, 28010167, 1530292965, 2, 508164038, 2, 54902992348, 51712929897, 1269, 2, 3217847072904, 8597641914, 9168720349613
Offset: 0
Non-isomorphic representatives of the a(2) = 2 through a(6) = 7 multiset partitions:
{{11}} {{111}} {{1111}} {{11111}} {{111111}}
{{1}{2}} {{1}{2}{3}} {{11}{22}} {{1}{2}{3}{4}{5}} {{111}{222}}
{{12}{12}} {{112}{122}}
{{1}{2}{3}{4}} {{11}{22}{33}}
{{11}{23}{23}}
{{12}{13}{23}}
{{1}{2}{3}{4}{5}{6}}
Inequivalent representatives of the a(6) = 7 matrices:
[6]
.
[3 0] [2 1]
[0 3] [1 2]
.
[2 0 0] [2 0 0] [1 1 0]
[0 2 0] [0 1 1] [1 0 1]
[0 0 2] [0 1 1] [0 1 1]
.
[1 0 0 0 0 0]
[0 1 0 0 0 0]
[0 0 1 0 0 0]
[0 0 0 1 0 0]
[0 0 0 0 1 0]
[0 0 0 0 0 1]
Inequivalent representatives of the a(9) = 7 matrices:
[9]
.
[3 0 0] [3 0 0] [2 1 0] [2 1 0] [1 1 1]
[0 3 0] [0 2 1] [1 1 1] [1 0 2] [1 1 1]
[0 0 3] [0 1 2] [0 1 2] [0 2 1] [1 1 1]
.
[1 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0]
[0 0 1 0 0 0 0 0 0]
[0 0 0 1 0 0 0 0 0]
[0 0 0 0 1 0 0 0 0]
[0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 0 1]
A321722
Number of non-normal magic squares whose entries are nonnegative integers summing to n.
Original entry on oeis.org
1, 1, 1, 1, 10, 21, 97, 657, 5618, 48918, 494530, 5383553, 65112565, 840566081, 11834555867, 176621056393, 2838064404989, 48060623405313
Offset: 0
The a(4) = 10 magic squares:
[4]
.
[1 1]
[1 1]
.
[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]
[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]
[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]
[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]
-
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@@Join[{Tr[prs2mat[#]],Tr[Reverse[prs2mat[#]]]},Total/@prs2mat[#],Total/@Transpose[prs2mat[#]]]]&]],{n,5}]
A321720
Number of non-normal (0,1) semi-magic squares with sum of entries equal to n.
Original entry on oeis.org
1, 1, 2, 6, 25, 120, 726, 5040, 40410, 362881, 3630840, 39916800, 479069574, 6227020800, 87181402140, 1307674370040, 20922977418841, 355687428096000, 6402388104196400, 121645100408832000, 2432903379962038320, 51090942171778378800, 1124000886592995642000, 25852016738884976640000
Offset: 0
Cf.
A006052,
A007016,
A057151,
A068313,
A008300,
A101370,
A104602,
A120732,
A271103,
A319056,
A319616.
-
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}]
A321724
Irregular triangle read by rows where T(n,k) is the number of non-isomorphic non-normal semi-magic square multiset partitions of weight n and length d = A027750(n, k).
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 3, 5, 1, 1, 5, 1, 1, 3, 7, 1, 1, 1, 1, 4, 9, 12, 11, 1, 1, 1, 1, 4, 15, 1, 1, 13, 31, 1, 1, 5, 43, 22, 1, 1, 1, 1, 5, 22, 103, 30, 1, 1, 1, 1, 6, 106, 264, 42, 1, 1, 30, 383, 1, 1, 6, 56, 1, 1, 1, 1, 7, 45, 321, 2804, 1731, 77, 1
Offset: 1
Triangle begins:
1
1 1
1 1
1 2 1
1 1
1 2 3 1
1 1
1 3 5 1
1 5 1
1 3 7 1
Inequivalent representatives of the T(10,3) = 7 semi-magic squares (zeros not shown):
[2 ] [2 ] [2 ] [2 ] [2 ] [11 ] [11 ]
[ 2 ] [ 2 ] [ 2 ] [ 11 ] [ 11 ] [11 ] [1 1 ]
[ 2 ] [ 2 ] [ 11 ] [ 11 ] [ 1 1 ] [ 11 ] [ 1 1 ]
[ 2 ] [ 11] [ 1 1] [ 11] [ 1 1] [ 1 1] [ 1 1]
[ 2] [ 11] [ 11] [ 11] [ 11] [ 11] [ 11]
A321723
Number of non-normal magic squares whose entries are all 0 or 1 and sum to n.
Original entry on oeis.org
1, 1, 0, 0, 9, 20, 96, 656, 5584, 48913, 494264, 5383552, 65103875, 840566080, 11834159652, 176621049784, 2838040416201, 48060623405312
Offset: 0
The a(4) = 9 magic squares:
[1 1]
[1 1]
.
[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]
[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]
[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]
[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]
-
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[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}]
A321698
MM-numbers of uniform regular multiset multisystems. Numbers whose prime indices all have the same number of prime factors counted with multiplicity, and such that the product of the same prime indices is a power of a squarefree number.
Original entry on oeis.org
1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 15, 16, 17, 19, 23, 25, 27, 29, 31, 32, 33, 41, 43, 47, 49, 51, 53, 55, 59, 64, 67, 73, 79, 81, 83, 85, 93, 97, 101, 103, 109, 113, 121, 123, 125, 127, 128, 131, 137, 139, 149, 151, 155, 157, 161, 163, 165, 167, 169, 177, 179
Offset: 1
The sequence of all uniform regular multiset multisystems, together with their MM-numbers, begins:
1: {} 33: {{1},{3}} 109: {{10}}
2: {{}} 41: {{6}} 113: {{1,2,3}}
3: {{1}} 43: {{1,4}} 121: {{3},{3}}
4: {{},{}} 47: {{2,3}} 123: {{1},{6}}
5: {{2}} 49: {{1,1},{1,1}} 125: {{2},{2},{2}}
7: {{1,1}} 51: {{1},{4}} 127: {{11}}
8: {{},{},{}} 53: {{1,1,1,1}} 128: {{},{},{},{},{},{}}
9: {{1},{1}} 55: {{2},{3}} 131: {{1,1,1,1,1}}
11: {{3}} 59: {{7}} 137: {{2,5}}
13: {{1,2}} 64: {{},{},{},{},{},{}} 139: {{1,7}}
15: {{1},{2}} 67: {{8}} 149: {{3,4}}
16: {{},{},{},{}} 73: {{2,4}} 151: {{1,1,2,2}}
17: {{4}} 79: {{1,5}} 155: {{2},{5}}
19: {{1,1,1}} 81: {{1},{1},{1},{1}} 157: {{12}}
23: {{2,2}} 83: {{9}} 161: {{1,1},{2,2}}
25: {{2},{2}} 85: {{2},{4}} 163: {{1,8}}
27: {{1},{1},{1}} 93: {{1},{5}} 165: {{1},{2},{3}}
29: {{1,3}} 97: {{3,3}} 167: {{2,6}}
31: {{5}} 101: {{1,6}} 169: {{1,2},{1,2}}
32: {{},{},{},{},{}} 103: {{2,2,2}} 177: {{1},{7}}
Cf.
A005176,
A007016,
A112798,
A271103,
A283877,
A299353,
A302242,
A306017,
A319056,
A319189,
A320324,
A321699,
A321717,
A322554,
A322703,
A322833.
-
primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
Select[Range[100],And[SameQ@@PrimeOmega/@primeMS[#],SameQ@@Last/@FactorInteger[Times@@primeMS[#]]]&]
Showing 1-10 of 12 results.
Comments