Processing math: 100%

Monday, 21 September 2020

Magic Squares

This post was inspired by my daily number analysis of my diurnal age. I was struggling to find something of interest about 26102 when I discovered that a 4×4 magic square could be created in which 26102 was the magic constant. This got me thinking about what numbers could be represented in this way as magic squares.

A n×n magic square has its n2 cells filled with the numbers from 1 to n2 in such a way that the sums of all rows, columns and main diagonals are the same. This sum is called the magic constant:n(n2+1)2

The 3×3 magic square contains the numbers from 1 to 9 and all rows, columns and main diagonals add up to 15. Thus the magic constant is 15.816357492
If we add 1 to each element of the above magic square, we get the next magic square and this has a magic constant of 18:9274685103
All subsequent 3×3 magic squares will have magic constants that are multiples of 3. Thus the number 26097 = 3 x 8699 can be represented as:8702869587008697869987015869887038696
We could represent the various matrices in terms of a subscript for their size and a superscript for their magic sum. This is purely my own invention but it means we would have: M153M183 and M260973 where M is any matrix that satisfies the condition of being magic and having a particular size and magic sum. The 4×4 magic square containing the numbers 1 to 15 has a magic sum of 34:16231351110897612414151
It would be designated as M344 in my system. The subsequent magic sums that are possible are 38, 42, 46, 50 and so on. To test whether a number can be the magic constant for a 4×4 magic square, simply subtract 34 from the number and test whether the result is divisible by 4. In the case of 26102, it is and so we have:6533651965206530652265286527652565266524652365296521653165326518
This magic square can be designated M261024. Figures 1 and 2 shows the magic squares together with their magic sums and associated planet or luminary.

Figure 1: source


Figure 2: source

The 5×5 magic square has a constant of 65 and so any subsequent multiples of 5 will be representable as 5×5 magic squares. The 6×6 magic square has a constant of 111 which is 3 x 37. This means that 117, 123, 129 etc. can be represented as 6×6 magic squares but these numbers are not multiples of 6. To determine whether a number can be the magic constant for a 6×6 magic square, the 111 must first be subtracted and the result tested for divisibility by 6. This is like the 4×4 case.

For the 7×7 magic square, the constant is 175 = 7 x 25 and so any multiple of 7 can be represented by a 7×7 magic square. For the 8×8 magic square, the constant is 260 = 4 x 65 which is not divisible by 8 and the situation is as the same as with 4 and 6. For the 9×9 magic square, the constant is 369 = 9 x 41 so all multiples of 9 above 369 qualify.

Figure 3 shows the magic constants for larger magic squares:


Figure 3: source

So generally, excluding 2, the prime factorisation of a number will quickly tell us what magic squares it can serve as a constant for. For example, 910 = 2 * 5 * 7 * 13 and so it can be represented by magic squares of side 5, 7 and 13. It can also be represented as a magic square with a composite number of sides but a little testing is required. For example, it can be represented as a 4×4 magic square but not 8×8. This site is great for such testing.

on May 14th 2021

No comments:

Post a Comment