Showing posts with label row. Show all posts
Showing posts with label row. Show all posts

Sunday, 18 August 2024

Prime Squared Semi-Magic Squares

I've made numerous posts about magic squares of one form or another and even posted about magic cubes and magic polygons. On 17th May 2021, I posted about Prime Semi-Magic Squares and today's post is also about semi-magic squares and primes, except that in this post I'll be looking at the squares of primes. Remember that a semi-magic square only needs to have its rows and columns adding to a constant, not its diagonals.

The number associated with my diurnal age today is 27531 and it has a property that qualifies it for membership is OEIS A269344:


 A269344

Magic sums of 3 X 3 semimagic squares composed of squares of primes.



The initial members of this sequence are:

5691, 26859, 27531, 85659, 93219, 111699, 113331, 155739, 179091, 203571, 228459, 239379, 277419, 281499, 344931, 376971, 469011, 487491, 490299, 520491, 583779, 631491, 679539, 806547, 851211, 896091, 922659, 1004379, 1067619, 1099539, 1119459, 1134771

The magic square associated with 27531, the third member of the sequence, is shown in Figure 1. All the rows and columns add to this number.


Figure 1: source

Now 27531 can be expressed as a sum of three primes squared in 16 different ways. See Figure 2.


Figure 2: permalink

Looking at these 16 different combinations of primes, it's easy to see the ones that were selected to form the magic square. Let's look at the second number in the sequence, 26859. See Figure 3 where all rows and columns add to 26859.


Figure 3: source

Now 26859 can be expressed as a sum of three primes squared in 18 different ways. See Figure 4.


Figure 4: permalink

This site shows the magic squares for all members of the sequence up to 1099539.

Thursday, 25 April 2024

Anti-Magic Squares Revisited

I've written about magic squares before. Here are links to these posts:

In this post, I intend to revisit anti-magic squares and the numbers associated with OEIS A117560:


 A117560

\( \text{a}(n) = \dfrac {n \cdot (n^2-1)}{2} - 1 \)



The OEIS comments state that:
\( \text{a}(n-1) \) is an approximation for the lower bound of the "antimagic constant" of an antimagic square of order \(n\). The antimagic constant here is defined as the least integer in the set of consecutive integers to which the rows, columns and diagonals of the square sum. 
The initial members of this sequence are:

2, 11, 29, 59, 104, 167, 251, 359, 494, 659, 857, 1091, 1364, 1679, 2039, 2447, 2906, 3419, 3989, 4619, 5312, 6071, 6899, 7799, 8774, 9827, 10961, 12179, 13484, 14879, 16367, 17951, 19634, 21419, 23309, 25307, 27416, 29639, 31979, 34439, 37022

27416 is highlighted because it is my diurnal age today and when I made my post about anti-magic squares on July 17th 2018, I was 25307 days old. This number immediately precedes 27416, a gap of 2109 (about 5.77 years in terms of days counted). It will be 2223 days, about 6.09 years, before the next number is reached.

The current number, 27416, relates to an approximation of the lowest integer of a 38 x 38 anti-magic square. Note that it is not necessarily the lowest, it's just an approximation. My July 2018 entry is quite thorough and there's no point repeating all the content there but Figure 1 shows an example of 4 x 4 anti-magic square just to reinforce the property of such a square.

Figure 1: source

The ten sums from a sequence of consecutive numbers, namely 
30, 31, 32, 33, 34, 35, 36, 37, 38, 39. Figure 2 shows a different arrangement. Note that OEIS A117560 gives 29 as the lower bound here.

Figure 2: source

Note that an anti-magic square differs from a so-called heterosquare. As explained in Wolfram Mathworld
A heterosquare is an \(n \times n\) array of the integers from \(1\) to \(n^2\) such that the rows, columns, and diagonals have different sums. By contrast, in a magic square, they have the same sum. There are no heterosquares of order two, but heterosquares of every odd order exist. They can be constructed by placing consecutive integers in a spiral pattern (Fults 1974, Madachy 1979). An antimagic square is a special case of a heterosquare for which the sums of rows, columns, and main diagonals form a sequence of consecutive integers.

Figure 3 shows an example of a 4 x 4 heterosquare:

Figure 3: source

These numbers do not form a sequence of consecutive integers and so they do not form an anti-magic square.