English   Japanese
Home   Site Map

# Magic rectangles

## What are magic rectangles?

A 2-dimensional magic rectangle of order (m1, m2) is defined as an m1 x m2 rectangular array in which all rows of the array sum to the same value (called the row constant or the row sum) and all columns of the array also do (the column constant or the column sum). It is not required that diagonals be magic. An order-(m1, m2) magic rectangle is called normal if the rectangle consists of consecutive integers from 1 to m1m2, and called non-normal if not. This site is concerned only with normal magic rectangles. Similarly, n-dimensional magic rectangles are defined.

The following figures are examples of associated 2-dimensional magic rectangles:

 14 10 4 5 7 1 3 8 13 15 9 11 12 6 2
 10 21 9 16 5 14 2 3 4 7 11 15 18 19 20 8 17 6 13 1 12
 26 19 8 31 25 13 4 20 6 34 24 14 1 27 3 7 15 18 21 29 33 9 35 22 12 2 30 16 32 23 11 5 28 17 10

Magic rectangles of (odd,odd)-order are used in order to construct magic cubes and magic tesseracts (see the pages for Nasik magic cubes and Nasik magic tesseracts). However, it is not easy to construct (odd,odd)-order magic rectangles algorithmically (discuss later). On the other hand, it is not so difficult to construct (even,even)-order magic rectangles (see the figure below). Normal magic rectangles of (odd,even)-order cannot exist.

 1 2 3 22 23 24 19 20 21 4 5 6 18 17 16 9 8 7 12 11 10 15 14 13

## Existence of magic rectangles

For m1, m2 > 1, an order-(m1, m2) 2-dimensional normal magic rectangle exists only if one of the following conditions is hold:
(1) Both m1 and m2 are even and at least one of them is greater than 2.
(2) Both m1 and m2 are odd.
T. Harmuth published a proof of this theorem in 1881. Thomas R. Hagedorn showed an elementary proof of the theorem with a concrete construction method in [2]. (The method is elementary but complicated.) He also proved the existence of the following magic rectangles in [1]:

(1) An order-(m1, m2, ..., mn) n-dimensional magic rectangle, where m1, .., mn > 1 are even integers and (mi, mj) is not (2,2) for 1 <= i < j <= n,
(2) An order-(m1, m2, m3) 3-dimensional magic rectangle, where m1, m2, m3 > 1 are odd integers and gcd(m1, m2) > 1, where gcd means the greatest common divisor.

Furthermore, it can be proved the existence of the following magic rectangles by generalizing the Hagedorn's proof:
(2)' An order-(m1, m2, ..., mn) n-dimensional magic rectangle, where m1, .., mn > 1 are odd integers and gcd(mi, mj) > 1 for some i and j such that1 <= i < j <= n.

As a result, 3-dimensional magic rectangles of orders (3,3,5), (3,3,7), (3,5,5), (3,5,9), (3,5,15), (3,7,15), etc. do exist. Hagedorn said in [1] that it was an open question whether an order-(3,5,7) 3-dimensional magic rectangle exists or not. I found an order-(3,5,7) 3-dimensional magic rectangle in April 2004, and an order-(3,5,11) and an order-(3,5,13) 3-dimensional magic rectangle in February 2005. I found these magic rectangles by searching by my personal computer (1.46GHz). It is unknown whether an order-(m1, m2, m3) 3-dimensional magic rectangle can exist or not for any odd m1, m2, m3 > 1.

## Examples of 3-dimensional magic rectangles

an order-(3,3,5) 3-dimensional magic rectangle (associated)
 31 3 38 13 30 24 41 12 36 2 14 25 19 20 37
 29 40 4 35 7 1 18 23 28 45 39 11 42 6 17
 9 26 27 21 32 44 10 34 5 22 16 33 8 43 15

an order-(3,3,7) 3-dimensional magic rectangle (associated)
 33 4 37 11 30 33 34 35 23 32 36 13 31 12 10 51 9 31 35 14 32
 25 36 24 46 5 44 2 3 34 7 26 45 18 49 50 8 47 6 28 16 27
 20 38 17 21 43 1 42 40 21 39 16 20 29 17 18 19 22 41 15 48 19

an order-(3,5,7) 3-dimensional magic rectangle (associated) [Nakamura, April 2004]
 70 54 35 99 22 87 4 63 29 93 45 92 24 25 89 94 38 9 18 67 56 41 31 40 34 48 76 101 2 57 59 78 85 11 79
 62 10 103 32 90 23 51 91 100 8 42 1 60 69 20 26 33 53 73 80 86 37 46 105 64 98 6 15 55 83 16 74 3 96 44
 27 95 21 28 47 49 104 5 30 58 72 66 75 65 50 39 88 97 68 12 17 81 82 14 61 13 77 43 102 19 84 7 71 52 36

an order-(3,5,11) 3-dimensional magic rectangle (associated) [Nakamura, February 2005]
 51 28 120 79 145 44 124 75 5 109 133 101 152 20 50 13 130 96 110 128 106 7 119 62 67 17 151 24 126 90 78 31 148 49 141 131 164 22 158 3 1 64 150 30 95 32 77 105 84 59 66 139 140 19 97
 129 74 103 143 4 98 43 113 155 6 45 12 81 127 34 73 111 9 137 86 118 125 112 52 94 156 58 83 108 10 72 114 54 41 48 80 29 157 55 93 132 39 85 154 121 160 11 53 123 68 162 23 63 92 37
 69 147 26 27 100 107 82 61 89 134 71 136 16 102 165 163 8 144 2 35 25 117 18 135 88 76 40 142 15 149 99 104 47 159 60 38 56 70 36 153 116 146 14 65 33 57 161 91 42 122 21 87 46 138 115

an order-(3,5,13) 3-dimensional magic rectangle (associated) [Nakamura, February 2005]
 37 106 131 13 116 121 58 74 171 182 187 26 52 84 69 55 180 173 93 175 70 18 31 85 91 150 193 134 36 44 43 101 89 167 54 78 15 192 128 166 79 155 124 12 38 148 2 190 99 8 120 133 10 102 113 129 146 137 20 177 57 100 195 61 27
 88 53 162 185 39 154 60 161 73 45 24 174 56 147 149 51 17 115 7 71 66 92 191 168 86 114 33 156 77 132 109 164 98 32 87 64 119 40 163 82 110 28 5 104 130 125 189 81 179 145 47 49 140 22 172 151 123 35 136 42 157 11 34 143 108
 169 135 1 96 139 19 176 59 50 67 83 94 186 63 76 188 97 6 194 48 158 184 72 41 117 30 68 4 181 118 142 29 107 95 153 152 160 62 3 46 105 111 165 178 126 21 103 23 16 141 127 112 144 170 9 14 25 122 138 75 80 183 65 90 159

References
[1] Thomas R. Hagedorn, On the existence of magic n-dimensional rectangles, Discrete Mathematics 207 (1999), 53-63.
[2] Thomas R. Hagedorn, Magic retangles revisited, Discrete Mathematics 207 (1999), 65-72.
[3] Marián Trenkler, Magic rectangles, The Mathematical Gazette 83(1999), 102-105.
[4] Harvey D. Heinz & John R. Hendricks, Magic Square Lexicon: Illustrated, self-published, 2000, ISBN 0-9687985-0-0.

Home   Site Map

Mitsutoshi Nakamura (Feedback)    To send an email to me, please enable JavaScript on your browser.
[Legal indication] Prohibit the send of any spam or advertising.