Orders 6n+3




To construct a 6n+3 pandiagonal magic square there are 4 steps. An order 6n+3 magic square has an odd magic constant just like orders 4n+2 and 6n±1. A 6n+3 pandiagonal magic square can also use consecutive integers like orders 6n±1. To prove this, each box in a square (order 9) gets a name and is expressed in the sum of each row, column and diagonal, which all add up to the same value s1.

a(1) a(2) a(3) a(4) a(5) a(6) a(7) a(8) a(9)
a(10) a(11) a(12) a(13) a(14) a(15) a(16) a(17) a(18)
a(19) a(20) a(21) a(22) a(23) a(24) a(25) a(26) a(27)
a(28) a(29) a(30) a(31) a(32) a(33) a(34) a(35) a(36)
a(37) a(38) a(39) a(40) a(41) a(42) a(43) a(44) a(45)
a(46) a(47) a(48) a(49) a(50) a(51) a(52) a(53) a(54)
a(55) a(56) a(57) a(58) a(59) a(60) a(61) a(62) a(63)
a(64) a(65) a(66) a(67) a(68) a(69) a(70) a(71) a(72)
a(73) a(74) a(75) a(76) a(77) a(78) a(79) a(80) a(81)
table 14: 9 by 9 square with 81 imaginary numers

Rows
a( 1)+a( 2)+a( 3)+a( 4)+a( 5)+a( 6)+a( 7)+a( 8)+a( 9) = s1
a(10)+a(11)+a(12)+a(13)+a(14)+a(15)+a(16)+a(17)+a(18) = s1
a(19)+a(20)+a(21)+a(22)+a(23)+a(24)+a(25)+a(26)+a(27) = s1
a(28)+a(29)+a(30)+a(31)+a(32)+a(33)+a(34)+a(35)+a(36) = s1
a(37)+a(38)+a(39)+a(40)+a(41)+a(42)+a(43)+a(44)+a(45) = s1
a(46)+a(47)+a(48)+a(49)+a(50)+a(51)+a(52)+a(53)+a(54) = s1
a(55)+a(56)+a(57)+a(58)+a(59)+a(60)+a(61)+a(62)+a(63) = s1
a(64)+a(65)+a(66)+a(67)+a(68)+a(69)+a(70)+a(71)+a(72) = s1
a(73)+a(74)+a(75)+a(76)+a(77)+a(78)+a(79)+a(80)+a(81) = s1

Columns
a(1)+a(10)+a(19)+a(28)+a(37)+a(46)+a(55)+a(64)+a(73) = s1
a(2)+a(11)+a(20)+a(29)+a(38)+a(47)+a(56)+a(65)+a(74) = s1
a(3)+a(12)+a(21)+a(30)+a(39)+a(48)+a(57)+a(66)+a(75) = s1
a(4)+a(13)+a(22)+a(31)+a(40)+a(49)+a(58)+a(67)+a(76) = s1
a(5)+a(14)+a(23)+a(32)+a(41)+a(50)+a(59)+a(68)+a(77) = s1
a(6)+a(15)+a(24)+a(33)+a(42)+a(51)+a(60)+a(69)+a(78) = s1
a(7)+a(16)+a(25)+a(34)+a(43)+a(52)+a(61)+a(70)+a(79) = s1
a(8)+a(17)+a(26)+a(35)+a(44)+a(53)+a(62)+a(71)+a(80) = s1
a(9)+a(18)+a(27)+a(36)+a(45)+a(54)+a(63)+a(72)+a(81) = s1

(broken) diagonals top-left to bottom-right
a(1)+a(11)+a(21)+a(31)+a(41)+a(51)+a(61)+a(71)+a(81) = s1
a(2)+a(12)+a(22)+a(32)+a(42)+a(52)+a(62)+a(72)+a(73) = s1
a(3)+a(13)+a(23)+a(33)+a(43)+a(53)+a(63)+a(64)+a(74) = s1
a(4)+a(14)+a(24)+a(34)+a(44)+a(54)+a(55)+a(65)+a(75) = s1
a(5)+a(15)+a(25)+a(35)+a(45)+a(46)+a(56)+a(66)+a(76) = s1
a(6)+a(16)+a(26)+a(36)+a(37)+a(47)+a(57)+a(67)+a(77) = s1
a(7)+a(17)+a(27)+a(28)+a(38)+a(48)+a(58)+a(68)+a(78) = s1
a(8)+a(18)+a(19)+a(29)+a(39)+a(49)+a(59)+a(69)+a(79) = s1
a(9)+a(10)+a(20)+a(30)+a(40)+a(50)+a(60)+a(70)+a(80) = s1

(broken) diagonals top-right to bottom-left
a(1)+a(18)+a(26)+a(34)+a(42)+a(50)+a(58)+a(66)+a(74) = s1
a(2)+a(10)+a(27)+a(35)+a(43)+a(51)+a(59)+a(67)+a(75) = s1
a(3)+a(11)+a(19)+a(36)+a(44)+a(52)+a(60)+a(68)+a(76) = s1
a(4)+a(12)+a(20)+a(28)+a(45)+a(53)+a(61)+a(69)+a(77) = s1
a(5)+a(13)+a(21)+a(29)+a(37)+a(54)+a(62)+a(70)+a(78) = s1
a(6)+a(14)+a(22)+a(30)+a(38)+a(46)+a(63)+a(71)+a(79) = s1
a(7)+a(15)+a(23)+a(31)+a(39)+a(47)+a(55)+a(72)+a(80) = s1
a(8)+a(16)+a(24)+a(32)+a(40)+a(48)+a(56)+a(64)+a(81) = s1
a(9)+a(17)+a(25)+a(33)+a(41)+a(49)+a(57)+a(65)+a(73) = s1

From these linear equations, different equations can be derived. These new equations will be expressed using only a few instead of all a(i) values.

a(73) = s1 - a(74) - a(75) - a(76) - a(77) - a(78) - a(79) - a(80) - a(81)
a(64) = s1 - a(65) - a(66) - a(67) - a(68) - a(69) - a(70) - a(71) - a(72)
a(55) = s1 - a(56) - a(57) - a(58) - a(59) - a(60) - a(61) - a(62) - a(63)
a(46) = s1 - a(47) - a(48) - a(49) - a(50) - a(51) - a(52) - a(53) - a(54)
a(37) = s1 - a(38) - a(39) - a(40) - a(41) - a(42) - a(43) - a(44) - a(45)
a(28) = s1 - a(29) - a(30) - a(31) - a(32) - a(33) - a(34) - a(35) - a(36)
a(27) = 7 * s1 / 3 - a(28) - a(35) - a(36) - a(37) - a(38) - a(43) - a(44) - 2 *a(45) - a(46) + a(49) + a(50) - a(53) + - a(54) - a(55) - a(56) - a(61) - a(62) - 2 * a(63) - a(64) - a(71) - a(72) - a(81)
a(26) = a(27) + a(28) - a(34) + a(38) - a(42) - a(44) + a(45) + a(46) + a(48) - a(50) - a(52) + a(56) - a(60) - a(62) + + a(63) + a(64) - a(70) - a(80) + a(81)
a(25) = a(26) - a(33) + a(36) + a(37) - a(41) - a(43) + a(44) + a(47) - a(49) - a(51) + a(54) + a(55) - a(59) - a(61) + + a(62) - a(69) + a(72) - a(79) + a(80)
a(24) = a(25) - a(32) + a(35) - a(40) - a(42) + a(43) + a(45) + a(46) - a(48) - a(50) + a(53) - a(58) - a(60) + a(61) + + a(63) - a(68) + a(71) - a(78) + a(79)
a(23) = a(24) - a(31) + a(34) - a(39) - a(41) + a(42) + a(44) - a(47) - a(49) + a(52) + a(54) - a(57) - a(59) + a(60) + + a(62) - a(67) + a(70) - a(77) + a(78)
a(22) = a(23) - a(30) + a(33) - a(38) - a(40) + a(41) + a(43) - a(46) - a(48) + a(51) + a(53) - a(56) - a(58) + a(59) + + a(61) - a(66) + a(69) - a(76) + a(77)
a(21) = a(22) - a(29) + a(32) - a(37) - a(39) + a(40) + a(42) - a(47) + a(50) + a(52) - a(54) - a(55) - a(57) + a(58) + + a(60) - a(65) + a(68) - a(75) + a(76)
a(20) = a(21) - a(28) + a(31) - a(38) + a(39) + a(41) - a(45) - a(46) + a(49) + a(51) - a(53) - a(56) + a(57) + a(59) + - a(63) - a(64) + a(67) - a(74) + a(75)
a(19) = s1 - a(20) - a(21) - a(22) - a(23) - a(24) - a(25) - a(26) - a(27)
a(18) = 2 *s1 + a(19) + 2*a(28) + a(29) + a(35) + 2*a(36) + a(37) - a(38) - 2*a(39) - 3*a(40) - 3*a(41) - 3*a(42) - 2*a(43) + + a(46) - 2*a(48) - 3*a(49) - 4*a(50) - 3*a(51) - a(52) + a(54) + a(55) - a(56) - 2*a(57) - 4*a(58) - 4*a(59) + - 3*a(60) - 2*a(61) + 3*a(64) + 2*a(65) + a(70) + 2*a(71) + 3*a(72) + 2 * a(73) + a(80) + a(81)
a(17) = a(18) + a(19) - a(26) + a(29) - a(35) + a(39) - a(44) + a(49) - a(53) + a(59) - a(62) + a(69) - a(71) + a(79) - a(80)
a(16) = a(17) - a(25) + a(27) + a(28) - a(34) + a(38) - a(43) + a(48) - a(52) + a(58) - a(61) + a(68) - a(70) + a(78) - a(79)
a(15) = a(16) - a(24) + a(26) - a(33) + a(36) + a(37) - a(42) + a(47) - a(51) + a(57) - a(60) + a(67) - a(69) + a(77) - a(78)
a(14) = a(15) - a(23) + a(25) - a(32) + a(35) - a(41) + a(45) + a(46) - a(50) + a(56) - a(59) + a(66) - a(68) + a(76) - a(77)
a(13) = a(14) - a(22) + a(24) - a(31) + a(34) - a(40) + a(44) - a(49) + a(54) + a(55) - a(58) + a(65) - a(67) + a(75) - a(76)
a(12) = a(13) - a(21) + a(23) - a(30) + a(33) - a(39) + a(43) - a(48) + a(53) - a(57) + a(63) + a(64) - a(66) + a(74) - a(75)
a(11) = a(12) - a(20) + a(22) - a(29) + a(32) - a(38) + a(42) - a(47) + a(52) - a(56) + a(62) - a(65) + a(72) + a(73) - a(74)
a(10) = s1 - a(11) - a(12) - a(13) - a(14) - a(15) - a(16) - a(17) - a(18)
a( 9) = s1 - a(18) - a(27) - a(36) - a(45) - a(54) - a(63) - a(72) - a(81)
a( 8) = s1 - a(17) - a(26) - a(35) - a(44) - a(53) - a(62) - a(71) - a(80)
a( 7) = s1 - a(16) - a(25) - a(34) - a(43) - a(52) - a(61) - a(70) - a(79)
a( 6) = s1 - a(15) - a(24) - a(33) - a(42) - a(51) - a(60) - a(69) - a(78)
a( 5) = s1 - a(14) - a(23) - a(32) - a(41) - a(50) - a(59) - a(68) - a(77)
a( 4) = s1 - a(13) - a(22) - a(31) - a(40) - a(49) - a(58) - a(67) - a(76)
a( 3) = s1 - a(12) - a(21) - a(30) - a(39) - a(48) - a(57) - a(66) - a(75)
a( 2) = s1 - a(11) - a(20) - a(29) - a(38) - a(47) - a(56) - a(65) - a(74)
a (1) = s1 - a( 2) - a( 3) - a( 4) - a( 5) - a( 6) - a( 7) - a( 8) - a(9)

For more information on this proof visit entertainmentmathematics.nl

The fraction $$\frac{7}{3}$$s1 that can be found in the derived equation a(27) (in bold), will always result in an integer, and therefore, any order 6n+3 pandiagonal magic square exists with consecutive integers. This is because order 6n+3 pandiagonal magic squares always have an order in the multiplication table of 3, the magic constant will therefore also be a part of this table. When multiplying any table of 3 numbers with 7/3, an integer will always be the result. From these new equations it becomes clear that s1 always stays an integer and a 6n+3 pandiagonal magic square can use consecutive integers. In the whole list of derived equations, only one time a fraction occurs for s1 for box a(27) and this fraction does not influence the ability of any order 6n+3 pandiagonal magic square to be consecutive.

To create an 6n+3 pandiagonal magic square the formula A+(6n+3)$$A^T$$-(6n+3)C (with n=1) must be used. A is a square filled in with the consecutive integers {1,2,3,4,5,6,7,8,9} and B is a transposed form of square A. C is a square completely filled in with ones. The 6n+3 portion of the equation functions as a way to regulate the numbers that will be filled in, it will never allow a number above $$n^2$$, as this is the last number in the consecutive series, and thus, the largest number in the magic square. If n=1 the resulting magic square would be of order 9. In the squares A and B, no number larger than 9 appears, therefore, the largest number that could result from the multiplication of (6n+3)$$A^T$$ is 81, which is also the largest number in the consecutive series of an order 8 magic square.

Step 1
The first step in creating an order 6n+3 pandiagonal magic square is to create a 3 by 3 square with the consecutive numbers 1 to 9. To make this 3 by 3 square the top row will be filled in with {1,2,3} in that order as well. For the next row however the numbers {4,5,6} all move one position to the left, therefore the second row will look like {5,6,4}. For the final row, the same thing happens as for the second row (each integer moves 1 position to the left) and it will look like {9,7,8}. To show the construction of an order 6n+3 pandiagonal magic square an order 9 pandiagonal magic square will be used. This magic square has a magic constant of 369.

1 2 3
5 6 4
9 7 8
table 15: building blocks in constructing an order 6n+3 (n=1) pandiagonal magic square

Step 2
To construct any order 6n+3 pandiagonal magic square the first three columns on the left have to be filled in with the 3 by 3 squares that were created in step 1. This is done by placing one below the other, till the all three columns are totally filled in. For the next three columns (columns 4, 5 and 6), the same process of filling in the 3 by 3 square repeats, however the positions of the rows inside the 3 by 3 square moves one row down. This alteration of the original square is then again filled in till all columns 4, 5 and 6 are completely filled in. Repeat this process (taking the previous 3 by 3 square and moving all rows down by one) with the next three columns, till the entire square - called square A - is completed.

1 2 3 9 7 8 5 6 4
5 6 4 1 2 3 9 7 8
9 7 8 5 6 4 1 2 3
1 2 3 9 7 8 5 6 4
5 6 4 1 2 3 9 7 8
9 7 8 5 6 4 1 2 3
1 2 3 9 7 8 5 6 4
5 6 4 1 2 3 9 7 8
9 7 8 5 6 4 1 2 3
table 16: 9 by 9 square A filled following step 1 of 6n+3 pandiagonal magic squares

In table 16, it becomes more clear how each three columns are filled in after each other. First the red values were filled in, followed by the blue and finally the green.

Step 3
Step 3 for an order 6n+3 pandiagonal magic square works the same as step 2 for an order 6n±1 pandiagonal magic square. The second square B is created by taking the transpose of square A. This can be achieved by swapping the rows and columns with each other.

1 5 9 1 5 9 1 5 9
2 6 7 2 6 7 2 6 7
3 4 8 3 4 8 3 4 8
9 1 5 9 1 5 9 1 5
7 2 6 7 2 6 7 2 6
8 3 4 8 3 4 8 3 4
5 9 1 5 9 1 5 9 1
6 7 2 6 7 2 6 7 2
4 8 3 4 8 3 4 8 3
table 17: square B of order 6n+3 (n=1) created by transposing square A

Step 4
To create a pandiagonal magic square of order 6n+3, the formula A+(6n+3)$$A^T$$-(6n+3)C is used. In the equation C is again an order 6n+3 (in this example order 9) square completely filled in with 1’s. In this example the formula would look like A+9$$A^T$$-9C and would result in the following pandiagonal magic square of order 6n+3 with n=1.

1 38 75 9 43 80 5 42 76
14 51 58 10 47 57 18 52 62
27 34 71 23 33 67 19 29 66
73 2 39 81 7 44 77 6 40
59 15 49 55 11 48 63 16 53
72 25 35 68 24 31 64 20 30
37 74 3 45 79 8 41 78 4
50 60 13 46 56 12 54 61 17
36 70 26 32 69 22 28 65 21
table 18: order 6n+3 (n=1) pandiagonal magic square