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
Pandiagonal 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!
==(6''n''±1)×(6''n''±1) pandiagonal magic squares== A <math>(6n \pm 1) \times (6n \pm 1)</math> pandiagonal magic square can be built by the following algorithm. {{Ordered list |Set up the first column of the square with the first <math>6n \pm 1</math> [[natural number]]s. {{aligned table|cols=7|class=wikitable | 1 | | | | | | | 2 | | | | | | | 3 | | | | | | | 4 | | | | | | | 5 | | | | | | | 6 | | | | | | | 7 | | | | | | }} |Copy the first column into the second column but shift it ring-wise by 2 rows. {{aligned table|cols=7|class=wikitable | 1 | 6 | | | | | | 2 | 7 | | | | | | 3 | 1 | | | | | | 4 | 2 | | | | | | 5 | 3 | | | | | | 6 | 4 | | | | | | 7 | 5 | | | | | }} |Continue copying the current column into the next column with ring-wise shift by 2 rows until the square is filled completely. {{aligned table|cols=7|class=wikitable | 1 | 6 | 4 | 2 | 7 | 5 | 3 | 2 | 7 | 5 | 3 | 1 | 6 | 4 | 3 | 1 | 6 | 4 | 2 | 7 | 5 | 4 | 2 | 7 | 5 | 3 | 1 | 6 | 5 | 3 | 1 | 6 | 4 | 2 | 7 | 6 | 4 | 2 | 7 | 5 | 3 | 1 | 7 | 5 | 3 | 1 | 6 | 4 | 2 }} |Build a second square and copy the [[transpose]] of the first square into it. {{aligned table|cols=2|class=wikitable | {{mvar|A}} {{aligned table|cols=7|class=wikitable | 1 | 6 | 4 | 2 | 7 | 5 | 3 | 2 | 7 | 5 | 3 | 1 | 6 | 4 | 3 | 1 | 6 | 4 | 2 | 7 | 5 | 4 | 2 | 7 | 5 | 3 | 1 | 6 | 5 | 3 | 1 | 6 | 4 | 2 | 7 | 6 | 4 | 2 | 7 | 5 | 3 | 1 | 7 | 5 | 3 | 1 | 6 | 4 | 2 }} | <math>A^T</math> {{aligned table|cols=7|class=wikitable | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 6 | 7 | 1 | 2 | 3 | 4 | 5 | 4 | 5 | 6 | 7 | 1 | 2 | 3 | 2 | 3 | 4 | 5 | 6 | 7 | 1 | 7 | 1 | 2 | 3 | 4 | 5 | 6 | 5 | 6 | 7 | 1 | 2 | 3 | 4 | 3 | 4 | 5 | 6 | 7 | 1 | 2 }} }} |Build the final square by multiplying the second square by <math>6n \pm 1</math>, adding the first square and subtract <math>6n \pm 1</math> in each cell of the square. Example: <math>A + (6n \pm 1)A^T - (6n \pm 1)B</math>, where {{mvar|B}} is the magic square with all cells as 1. {{aligned table|cols=7|class=wikitable | 1 | 13 | 18 | 23 | 35 | 40 | 45 | 37 | 49 | 5 | 10 | 15 | 27 | 32 | 24 | 29 | 41 | 46 | 2 | 14 | 19 | 11 | 16 | 28 | 33 | 38 | 43 | 6 | 47 | 3 | 8 | 20 | 25 | 30 | 42 | 34 | 39 | 44 | 7 | 12 | 17 | 22 | 21 | 26 | 31 | 36 | 48 | 4 | 9 }} }}
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)