Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Magic square
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Continuous enumeration methods=== Exhaustive enumeration of all the borders of a magic square of a given order, as done previously, is very tedious. As such a structured solution is often desirable, which allows us to construct a border for a square of any order. Below we give three algorithms for constructing border for odd, doubly even, and singly even squares. These continuous enumeration algorithms were discovered in 10th century by Arab scholars; and their earliest surviving exposition comes from the two treatises by al-Buzjani and al-Antaki, although they themselves were not the discoverers.<ref name="Sesiano2007"/> Since then many more such algorithms have been discovered. '''Odd-ordered squares''': The following is the algorithm given by al-Buzjani to construct a border for odd squares. A peculiarity of this method is that for order ''n'' square, the two adjacent corners are numbers {{tmath|1=n - 1}} and {{tmath|1=n + 1}}. Starting from the cell above the lower left corner, we put the numbers alternately in left column and bottom row until we arrive at the middle cell. The next number is written in the middle cell of the bottom row just reached, after which we fill the cell in the upper left corner, then the middle cell of the right column, then the upper right corner. After this, starting from the cell above middle cell of the right column already filled, we resume the alternate placement of the numbers in the right column and the top row. Once half of the border cells are filled, the other half are filled by numbers complementary to opposite cells. The subsequent inner borders is filled in the same manner, until the square of order 3 is filled.<ref name="Sesiano2007"/> Below is an example for 9th-order square. {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:18em;height:18em;table-layout:fixed;" |- | style="background-color: cyan"|'''8''' || 80 || 78 || 76 || 75 || '''12''' || '''14''' || '''16''' || style="background-color: cyan"|'''10''' |- | 67 || style="background-color: cyan"|'''22''' || 64 || 62 || 61 || '''26''' || '''28''' || style="background-color: cyan"|'''24''' || '''15''' |- | 69 || 55 || style="background-color: cyan"|'''32''' || 52 || 51 || '''36''' || style="background-color: cyan"|'''34''' || '''27''' || '''13''' |- | 71 || 57 || 47 || style="background-color: cyan"|'''38''' || 45 || style="background-color: cyan"|'''40''' || '''35''' || '''25''' || '''11''' |- | 73 || 59 || 49 || 43 || style="background-color: pink"|'''41''' || style="background-color: yellow"|'''39''' || style="background-color: yellow"|'''33''' || style="background-color: yellow"|'''23''' || style="background-color: yellow"|'''9''' |- | '''5''' || '''19''' || '''29''' || 42 || style="background-color: yellow"|'''37''' || 44 || 53 || 63 || 77 |- | '''3''' || '''17''' || 48 || '''30''' || style="background-color: yellow"|'''31''' || 46 || 50 || 65 || 79 |- | '''1''' || 58 || '''18''' || '''20''' || style="background-color: yellow"|'''21''' || 56 || 54 || 60 || 81 |- | 72 || '''2''' || '''4''' || '''6''' || style="background-color: yellow"|'''7''' || 70 || 68 || 66 || 74 |} '''Doubly even order''': The following is the method given by al-Antaki. Consider an empty border of order ''n'' = 4''k'' with ''k'' β₯ 3. The peculiarity of this algorithm is that the adjacent corner cells are occupied by numbers ''n'' and {{tmath|1=n - 1}}. Starting at the upper left corner cell, we put the successive numbers by groups of four, the first one next to the corner, the second and the third on the bottom, and the fourth at the top, and so on until there remains in the top row (excluding the corners) six empty cells. We then write the next two numbers above and the next four below. We then fill the upper corners, first left then right. We place the next number below the upper right corner in the right column, the next number on the other side in the left column. We then resume placing groups of four consecutive numbers in the two columns as before. Once half of the border cells are filled, the other half are filled by numbers complementary to opposite cells.<ref name="Sesiano2007"/> The example below gives the border for order 16 square. {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:38em;height:38em;table-layout:fixed;" |- | style="background-color: cyan"|'''15''' || '''1''' || 255 || 254 || '''4''' || '''5''' || 251 || 250 || '''8''' || style="background-color: pink"|'''9''' || style="background-color: pink"|'''10''' || 246 || 245 || 244 || 243 || style="background-color: cyan"|'''16''' |- | 240 || || || || || || || || || || || || || || || style="background-color: yellow"|'''17''' |- | style="background-color: yellow"|'''18''' || || || || || || || || || || || || || || || 239 |- | '''19''' || || || || || || || || || || || || || || || 238 |- | 237 || || || || || || || || || || || || || || || '''20''' |- | 236 || || || || || || || || || || || || || || || '''21''' |- | '''22''' || || || || || || || || || || || || || || || 235 |- | '''23''' || || || || || || || || || || || || || || || 234 |- | 233 || || || || || || || || || || || || || || || '''24''' |- | 232 || || || || || || || || || || || || || || || '''25''' |- | '''26''' || || || || || || || || || || || || || || || 231 |- | '''27''' || || || || || || || || || || || || || || || 230 |- | 229 || || || || || || || || || || || || || || || '''28''' |- | 228 || || || || || || || || || || || || || || || '''29''' |- | '''30''' || || || || || || || || || || || || || || || 227 |- | 241 || 256 || '''2''' || '''3''' || 253 || 252 || '''6''' || '''7''' || 249 || 248 || 247 || style="background-color: pink"|'''11''' || style="background-color: pink"|'''12''' || style="background-color: pink"|'''13''' || style="background-color: pink"|'''14''' || 242 |} For order 8 square, we just begin directly with the six cells. {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:16em;height:16em;table-layout:fixed;" |- | style="background-color: cyan"|'''7''' || style="background-color: pink"|'''1''' || style="background-color: pink"|'''2''' || 62 || 61 || 60 || 59 || style="background-color: cyan"|'''8''' |- | 56 || || || || || || || '''9''' |- | '''10''' || || || || || || || 55 |- | '''11''' || || || || || || || 54 |- | 53 || || || || || || || '''12''' |- | 52 || || || || || || || '''13''' |- | '''14''' || || || || || || || 51 |- | 57 || 64 || 63 || style="background-color: pink"|'''3''' || style="background-color: pink"|'''4''' || style="background-color: pink"|'''5''' || style="background-color: pink"|'''6''' || 58 |} '''Singly even order''': For singly even order, we have the algorithm given by al-Antaki. Here the corner cells are occupied by ''n'' and ''n'' − 1. Below is an example of 10th-order square. Start by placing 1 at the bottom row next to the left corner cell, then place 2 in the top row. After this, place 3 at the bottom row and turn around the border in anti-clockwise direction placing the next numbers, until ''n'' − 2 is reached on the right column. The next two numbers are placed in the upper corners (''n'' − 1 in upper left corner and ''n'' in upper right corner). Then, the next two numbers are placed on the left column, then we resume the cyclic placement of the numbers until half of all the border cells are filled. Once half of the border cells are filled, the other half are filled by numbers complementary to opposite cells.<ref name="Sesiano2007"/> {| class="wikitable" style="margin-left:auto;margin-right:auto;text-align:center;width:22em;height:22em;table-layout:fixed;" |- | style="background-color: cyan"|'''9''' || 100 || style="background-color: pink"|'''2''' || 98 || '''5''' || 94 || 88 || '''15''' || 84 || style="background-color: cyan"|'''10''' |- | 83 || || || || || || || || || '''18''' |- | '''16''' || || || || || || || || || 85 |- | 87 || || || || || || || || || '''14''' |- | style="background-color: yellow"|'''12''' || || || || || || || || || 89 |- | style="background-color: yellow"|'''11''' || || || || || || || || || 90 |- | 93 || || || || || || || || || style="background-color: yellow"|'''8''' |- | '''6''' || || || || || || || || || 95 |- | 97 || || || || || || || || || '''4''' |- | 91 || style="background-color: pink"|'''1''' || 99 || '''3''' || 96 || '''7''' || '''13''' || 86 || '''17''' || 92 |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)