Orders 4n+2




Order 4n+2 pandiagonal magic squares do not exist for consecutive numbers. When looking at an order 6 pandiagonal magic square the following magic square can be derived.

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)
table 1: 6 by 6 square with 36 imaginary numbers

A pandiagonal magic square should have all it’s columns, rows and (broken) diagonals equate to the magic constant (s1 in example below). This would result in the following equations.

Rows
a( 1) + a( 2) + a( 3) + a( 4) + a( 5) + a( 6) = s1
a( 7) + a( 8) + a( 9) + a(10) + a(11) + a(12) = s1
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) = s1
a(25) + a(26) + a(27) + a(28) + a(29) + a(30) = s1
a(31) + a(32) + a(33) + a(34) + a(35) + a(36) = s1

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

(Broken) diagonals top-left to bottom-right
a( 1) + a( 8) + a(15) + a(22) + a(29) + a(36) = s1
a( 2) + a( 9) + a(16) + a(23) + a(30) + a(31) = s1
a( 3) + a(10) + a(17) + a(24) + a(25) + a(32) = s1
a( 4) + a(11) + a(18) + a(19) + a(26) + a(33) = s1
a( 5) + a(12) + a(13) + a(20) + a(27) + a(34) = s1
a( 6) + a( 7) + a(14) + a(21) + a(28) + a(35) = s1

(Broken) diagonals top-right to bottom-left

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

These equations account for all rows, columns and (broken diagonals) of an order 6 magic square. These equations can be transformed to the following equations, through use of substitution and manipulation.

a(31) = s1 - a(32) - a(33) - a(34) - a(35) - a(36)
a(25) = s1 - a(26) - a(27) - a(28) - a(29) - a(30)
a(19) = s1 - a(20) - a(21) - a(22) - a(23) - a(24)
a(17) = 2/3 * s1 - a(18) + a(20) + a(21) - a(23) - a(24) + a(26) + a(27) - a(29) - a(30) - a(35) - a(36)
a(16) = 2 * s1 + a(18) - a(20) - 2*a(21) - 2*a(22) - a(23) - a(26) - 2*a(27) - 2*a(28) - a(29) - a(34) + a(36)
a(15) = 2/3 * s1 - a(18) - a(33) - a(36)
a(14) = a(18) - a(20) - a(21) + a(23) + a(24) - a(26) - a(27) + a(29) + a(30) - a(32) + a(36)
a(13) = -4/3 * s1 - a(18) + a(20) + 2*a(21) + 2*a(22) + a(23) + a(26) + 2*a(27) + 2*a(28) + a(29) - a(31) - a(36)
a(12) = 11/6 * s1 - a(20) - a(21) - a(22) - a(26) - 2*a(27) - a(28) - a(32) - a(33) - a(34)
a(11) = -7/6 * s1 + a(22) + a(23) + a(24) - a(26) + a(28) + a(29) + a(30) + a(34) + a(35) + a(36)
a(10) = -7/6 * s1 + a(21) + a(22) + a(23) - a(25) + a(27) + a(28) + a(29) + a(33) + a(34) + a(35)
a(9) = -7/6 * s1 + a(20) + a(21) + a(22) + a(26) + a(27) + a(28) - a(30) + a(32) + a(33) + a(34)
a(8) = 11/6 * s1 - a(22) - a(23) - a(24) - a(28) - 2*a(29) - a(30) - a(34) - a(35) - a(36)
a(7) = 11/6 * s1 - a(21) - a(22) - a(23) - a(27) - 2*a(28) - a(29) - a(33) - a(34) - a(35)
a(6) = -5/6 * s1 - a(18) + a(20) + a(21) + a(22) - a(24) + a(26) + 2*a(27) + a(28) - a(30)+a(32)+a(33)+a(34)-a(36)
a(5) = 1/2 * s1 + a(18) + a(19) + a(24) - a(27) - a(28) - a(29) - a(34) - a(35)
a(4) = 1/6 * s1 - a(18) + a(20) + a(21) - a(28) - a(29) - a(30) + a(31) + a(32)
a(3) = 1/2 * s1 + a(18) - a(20) - 2*a(21) - a(22) - a(26) - 2*a(27) - a(28) + a(30) + a(31) + a(35) + 2*a(36)
a(2) = 1/6 * s1 - a(18) + a(21) + a(22) - a(25) - a(26) - a(30) + a(34) + a(35)
a(1) = 1/2 * s1 + a(18) + a(23) + a(24) - a(25) - a(26) - a(27) - a(31) - a(32)

For more information on this proof visit entertainmentmathematics.nl

From these newly derived equations it is clearly deductible that no solutions can be found for consecutive integers 1,2,...36. This is because the magic constant 111 is an odd number. This would result in numbers that are not integers, for example, ½*111(s1) = 55.5 (a(5) in the equations above (bold)). Henceforth, there cannot be a pandiagonal magic square with consecutive integers. All magic constants for 4n+2 pandiagonal magic squares are odd magic constants.

To create a 4n+2 pandiagonal magic square with non consecutive numbers there is a clear pattern to follow. To demonstrate this an order 6 magic square will be used. If the consecutive integers 1+2+3+4+5+6=21 are used, an odd sum will appear (21). As proven above a row, column or diagonal cannot sum up to an odd value. Therefore, for a 6 by 6 magic square the numbers 1+2+3+5+6+7=24 will be used, as this is the closest to a consecutive series that is possible for a pandiagonal magic square of order 4n+2. These 6 numbers will be specifically used to show what the algorithm for constructing an 4n+2 magic square would look like. Later on, these numbers will change into the a(i) numbers as demonstrated above. The sum 24 can be divided in half, when splitting the six numbers into appropriate groups (1,5,6 and 2,3,7). If these two sets of three numbers are squared, they will both equate to the number 62, adding a semi-bimagic property to the magic square. Because the series with a sum of 21 lacks this ability to half itself, they can not be arranged equally in the six by six grid. In return, it would be impossible to create a magic square from it, as the rows, columns and diagonals, at the starting point of the algorithm (explained below) would already not equate to the same amount on the rows, columns and diagonals. To create an order 6 (or 4n+2) non consecutive pandiagonal magic square, two order 6 squares must be filled in with numbers {1,2,3,5,6,7}. These squares will work as a matrix. Later on a multiplication step is needed to add both matrices, in combination with a matrix completely filled in with 1’s, together to form the final pandiagonal magic square of order 4n+2 (order 6).

The formula which will be used is β*A+B-β*C (β is the last integer in each array/series of numbers). Matrix A and B, will be filled in with the numbers {1,2,3,5,6,7} and matrix C is the matrix containing the ones.The β 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. β always needs to be the largest number that can be found in squares A and B (β=7). In the squares A and B, no number larger than 7 appears, therefore, the largest number that could result from the multiplication of β*A is 49, which is also the largest number in the consecutive series of an order 7 magic square. And because only six numbers are used (exculding 4) in squares A and B for a 4n+2 pandiagonal magic square, it will be the largest number in there as well.

Square A
For the first square A the square will be vertically split in two (indicated with a bold line in table 2 below). The left half will be starting at the top with {1,5,6}, in the next row the numbers will all move one space to the left resulting in {5,6,1}. Fill in each next row by moving the numbers one space to the left after each row till all 6 rows of length 3 are filled in. The same rule applies to the right half however the top row starts with {7,3,2} which is followed by the next row with {3,2,7}. When all 6 rows are filled in on the right side, square A has been constructed.

1 5 6 7 3 2
5 6 1 3 2 7
6 1 5 2 7 3
1 5 6 7 3 2
5 6 1 3 2 7
6 1 5 2 7 3

table 2: square A for order 6 pandiagonal magic square

Square B
To create square B, it will have to be split horizontally into equal slices (marked in bold in table 3 below). The top half will start on the right with {6,1,5} and move down (to the right in array) one for each next column of length 3 (e.g. {5,6,1}) till all 6 half columns have been filled in. To complete the bottom half of square B, the sequence {2,7,3} will start on the left and will also move down (to the right in the array) one position for each next column. Once this has been completed square B is finished.

6 5 1 6 5 1
1 6 5 1 6 5
5 1 6 5 1 6
2 3 7 2 3 7
7 2 3 7 2 3
3 7 2 3 7 2

table 3: square B for order 6 pandiagonal magic square

Square C
In addition to squares A and B there is also a square C, which is entirely filled with the number 1.

1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1

table 4: square C for order 6 pandiagonal magic square

Final square
To finally get the pandiagonal magic square for an order 6 pandiagonal magic square with non consecutive numbers the aformentioned formula β*A+B-β*C will be implemented. (β is the last integer in each array/series of numbers). For an order 6 pandiagonal magic square the formula would look like 7A+B-7C. For the top left square this would be 7*1+6-7*1=6. Finally, a pandiagonal magic square with non consecutive numbers will appear with the highest integer being 49 and the magic constant being 150. The semi-bimagic feature (only rows and columns) will have a magic constant of 5150.

6 33 36 48 19 8
29 41 5 15 13 47
40 1 34 12 43 20
2 31 42 44 17 14
35 37 3 21 9 45
38 7 30 10 49 16

table 5: order 6 pandiagonal square with non consecutive numbers