Showing posts with label 3 x 3 magic square. Show all posts
Showing posts with label 3 x 3 magic square. Show all posts

Saturday, 27 June 2026

Prime Magic Squares

The number associated with my diurnal age today, \( \textbf{28209} \), is a member of OEIS A269324:


A269324
: magic sums of 3 x 3 magic squares composed of primes in an arithmetic progression.

I was interested in finding out what these primes were and how they could be arranged so I sought help from Gemini. Here was what it came up with:

To construct a 3×3 magic square of primes in an arithmetic progression for the magic sum 28209 (a term from OEIS A269324), we need to determine the central prime, find the common difference of the progression, and then map those primes to the cells of the grid. Here is the complete step-by-step breakdown of the mathematics and the final arrangement.

1. Finding the Central Prime

In any 3×3 magic square, the central cell is always the average of the magic sum. Because the magic sum (\( S \)) is the total of any given row, column, or diagonal, the center prime is exactly \( S / 3 \).

$$ \text{Center} = \frac{28209}{3} = 9403 $$

Because the 9 primes must form an arithmetic progression, the central cell of the magic square must also be the median (the 5th term) of the sorted sequence. Therefore, our arithmetic progression of primes is centered at 9403.

2. Determining the Common Difference

Let \( d \) be the common difference. Our 9 primes will take the form of \( 9403 + kd \), where \( k \) ranges from \( -4 \) to \( 4 \).

According to prime arithmetic progression properties, an arithmetic progression of \( k \) primes must have a common difference divisible by every prime \( q \le k \) (unless the progression actually begins with \( q \)). Since our sequence contains 9 primes and does not start with 2, 3, 5, or 7, the common difference \( d \) must be a multiple of their primorial:

$$ d = 2 \times 3 \times 5 \times 7 = 210 $$

By testing the multiples of 210, we can find the exact difference where all 9 resulting terms are prime:

  • \( d = 210 \) fails because the term \( 9403 - 210 = 9193 \), which is \( 29 \times 317 \).
  • \( d = 420 \) fails because \( 9403 + 420 = 9823 \), which is \( 11 \times 19 \times 47 \).
  • \( d = 630 \) fails because \( 9403 - 3(630) = 7513 \), which is \( 11 \times 683 \).
  • \( d = 840 \) succeeds.

3. The Nine Primes

Using \( d = 840 \) and our center prime of 9403, we can generate the 9 primes for the magic square by stepping out by 840 in both directions:

  • \( 9403 - 4(840) = \) 6043
  • \( 9403 - 3(840) = \) 6883
  • \( 9403 - 2(840) = \) 7723
  • \( 9403 - 1(840) = \) 8563
  • 9403 (Center)
  • \( 9403 + 1(840) = \) 10243
  • \( 9403 + 2(840) = \) 11083
  • \( 9403 + 3(840) = \) 11923
  • \( 9403 + 4(840) = \) 12763

4. Arranging the Magic Square

To arrange these into a valid 3×3 magic square, we map our ordered sequence to the classic Lo Shu magic square structure. In the traditional 1–9 Lo Shu square, the numbers are placed so that opposites balance out across the center (5). Substituting our 1st through 9th primes directly into the equivalent positions of the Lo Shu configuration yields the following layout:

11923 6043 10243
7723 9403 11083
8563 12763 6883

Every row, column, and main diagonal in this grid perfectly sums to 28209. Keep in mind that any of the 8 standard symmetries (rotations or reflections) of this exact grid will also produce a valid magic square for this progression.

Monday, 5 August 2019

De Polignac Numbers


Today I turned 25691 days old and one of the properties of this number is that it's a de Polignac number. Moreover, it's the smaller of a pair of such numbers with the larger member of the pair being 25693. Numbers Aplenty must hold these numbers in high regard because, for every odd number searched for, it makes a point of declaring whether it is de Polignac or not. Figure 1 and Figure 2 illustrate this.


Figure 1: screenshot from source showing that
25689 is not a de Polignac number


Figure 2: screenshot from source showing that
25691 is a de Polignac number

Numbers Aplenty defines a de Polignac number as follows:
A de Polignac number is an odd number \(n\) that cannot be expressed as \(n=2^k+p\), for \(p\) prime.
This definition is equivalent to there being no prime \(p=n-2^k\) for values of \(2^k<n\). In the case of \(25689\), it is shown that \(2^4\) when subtracted from \(25689\) produces the prime \(25673\). Therefore \(25689\) is not a de Polignac number. In the case of \(25691\), it looks as if the expression \(2^k-25691\) should be reversed and instead read \(25691-2^k\).

Some interesting facts about de Polignac numbers include:
  • There are many de Polignac consecutive odd numbers that differ by 2. The earliest ones are: 905 & 907. Others are 3341 & 3343; 3431 &3433; and so on. However, there are no de Polignac twin primes. Source.
  • In the interval 5 to 50,000,000 there are about 21.8% (477445/2188591) of de Polignac numbers that are prime and this number slowly decreases. Thus composite de Polignac are more abundant than prime de Polignac. Source.
  • Paul Erdös proved that there are an infinity of de Polignac numbers, for example all the numbers of the form 1260327937 + 2863311360⋅\(k\). Source.
  • The smallest composite de Polignac number is 905, while the first square is 40401. Source.
  • The smallest 3 × 3 magic square whose entries are de Polignac numbers is shown in Figure 3. Source.
    Figure 3: magic square of de Polignac numbers
  •  \(10^{999} +18919\) is the earliest titanic Polignac prime number. The next are:
\(10^{999} + 25561\)
\(10^{999} + 28047\)
\(10^{999} + 28437\)
\(10^{999} + 41037\)
\(10^{999} + 55587\)
\(10^{999} + 63177\)
\(10^{999} + 73209\)
\(10^{999} + 75301\)
\(10^{999} + 90079\)
Source
  • \(2^{2^n} - 5\) is a de Polignac number for each n > 2 e.g. 251, 65531, 4294967291, ... Source.
Here are some biographical details concerning the mathematician after whom these numbers are named. Source.
Alphonse de Polignac (1826–1863) was a French mathematician. In 1849, the year he was admitted to Polytechnique, he made what's known as Polignac's conjecture: 
For every positive integer \(k\), there are infinitely many prime gaps of size \(2k\). The case \(k = 1\) is the twin prime conjecture. 
His father, Jules de Polignac (1780-1847) was prime minister of Charles X until the Bourbon dynasty was overthrown (1830).
Here a permalink to SageMathCell and below is the SageMath code that I developed to identify de Polignac numbers within a given range (in the example, between 25500 and 25600):
INPUT 
upper=26000
power=ceil(log(upper, 2))
NP=[]
for p in prime_range(2, upper):
    for k in [0..power]:
        if (2^k+p)<upper:
            NP.append(2^k+p)
N=[x for x in [1..upper]]
for x in (Set(N)-Set(NP)):
    if x%2==1:
        if x>25600 and x<26000:
            print x, 
OUTPUT 
25627 25631 25691 25693 25723 25739 25747 25753 25777 25783 25799 25829 25841 25909 25925 25961 25979 25987 25993