Wednesday, 1 July 2026

Sphenic Number Chains

My previous post on the topic of chains of semiprimes in arithmetic progression prompted me to investigate similar chains formed by sphenic numbers. This time we are looking for the smallest sphenic number that is at the end of an arithmetic progression of \(n\) sphenic numbers as \(n\) ranges from 1 upwards. The result for \(n\) up to 18 is as follows (permalink):

30, 42, 102, 138, 174, 442, 1010, 2278, 2422, 6494, 10322, 10586, 12694, 21434, 28466, 56426, 62902, 145930

Let's look at 28466 that is at the end of a chain of 15 sphenic numbers with a common difference of 96 (permalink):

Arithmetic Progression of 15 Sphenic Numbers
Common Difference: 96
-------------------------------------------------------
Term   | Sphenic Number   | Factorisation
-------------------------------------------------------
1      | 27122            | 2 x 71 x 191
2      | 27218            | 2 x 31 x 439
3      | 27314            | 2 x 7 x 1951
4      | 27410            | 2 x 5 x 2741
5      | 27506            | 2 x 17 x 809
6      | 27602            | 2 x 37 x 373
7      | 27698            | 2 x 11 x 1259
8      | 27794            | 2 x 13 x 1069
9      | 27890            | 2 x 5 x 2789
10     | 27986            | 2 x 7 x 1999
11     | 28082            | 2 x 19 x 739
12     | 28178            | 2 x 73 x 193
13     | 28274            | 2 x 67 x 211
14     | 28370            | 2 x 5 x 2837
15     | 28466            | 2 x 43 x 331
-------------------------------------------------------

Other tables can be generated for the other values of \(n\) but the above table is the most relevant because it covers numbers (28274, 28370 and 28466) that are upcoming for me in terms of my diurnal age.

Here are the results for 16 sphenic numbers in arithmetic progression:

Arithmetic Progression of 16 Sphenic Numbers
Common Difference: 708
-------------------------------------------------------
Term   | Sphenic Number   | Factorisation
-------------------------------------------------------
1      | 45806            | 2 x 37 x 619
2      | 46514            | 2 x 13 x 1789
3      | 47222            | 2 x 7 x 3373
4      | 47930            | 2 x 5 x 4793
5      | 48638            | 2 x 83 x 293
6      | 49346            | 2 x 11 x 2243
7      | 50054            | 2 x 29 x 863
8      | 50762            | 2 x 17 x 1493
9      | 51470            | 2 x 5 x 5147
10     | 52178            | 2 x 7 x 3727
11     | 52886            | 2 x 31 x 853
12     | 53594            | 2 x 127 x 211
13     | 54302            | 2 x 19 x 1429
14     | 55010            | 2 x 5 x 5501
15     | 55718            | 2 x 13 x 2143
16     | 56426            | 2 x 89 x 317
-------------------------------------------------------

Semiprime Chains

My diurnal age today, 28213, is a member of OEIS A096003:


A096003: \( \textbf{smallest}\) semiprime which is at the \( \textbf{end}\) of an arithmetic progression of \(n\) semiprimes.

The initial terms of the sequence are:

4, 6, 14, 46, 58, 221, 445, 497, 1211, 1561, 4195, 4393, 6347, 10717, 14233, 28213, 31451, 72965

In the case of 28213, the chain is 16 semiprimes long with a common difference of 354 as shown in the table below  (permalink):

Semiprime    | Factors
------------------------------
22903        | 37 * 619
23257        | 13 * 1789
23611        | 7 * 3373
23965        | 5 * 4793
24319        | 83 * 293
24673        | 11 * 2243
25027        | 29 * 863
25381        | 17 * 1493
25735        | 5 * 5147
26089        | 7 * 3727
26443        | 31 * 853
26797        | 127 * 211
27151        | 19 * 1429
27505        | 5 * 5501
27859        | 13 * 2143
28213        | 89 * 317

The terms in comma separated form are:

22903, 23257, 23611, 23965, 24319, 24673, 25027, 25381, 25735, 26089, 26443, 26797, 27151, 27505, 27859, 28213

28213 is also an emirpimes since \(31282 = 2 \times 15641\) and even the factors of 28213 when concatenated from higher to lower form the semiprime \(31789 = 83 \times 383\).

The next term in OEIS A096003 after 29213 is 31451 and it is at the end of a chain of 17 semiprimes with a common difference of 1860 as shown in the table below (permalink)

Semiprime    | Factors
------------------------------
1691          | 19 * 89
3551          | 53 * 67
5411          | 7 * 773
7271          | 11 * 661
9131          | 23 * 397
10991        | 29 * 379
12851        | 71 * 181
14711        | 47 * 313
16571        | 73 * 227
18431        | 7 * 2633
20291        | 103 * 197
22151        | 17 * 1303
24011        | 13 * 1847
25871        | 41 * 631
27731        | 11 * 2521
29591        | 127 * 233
31451        | 7 * 4493

The terms in comma separated form are:

1691, 3551, 5411, 7271, 9131, 10991, 12851, 14711, 16571, 18431, 20291, 22151, 24011, 25871, 27731, 29591, 31451

After 31451 comes 72965 that is at the end of a chain of 18 semiprimes with a common difference of 3942 as shown in the table below (permalink):

Semiprime    | Factors
------------------------------
5951          | 11 * 541
9893          | 13 * 761
13835        | 5 * 2767
17777        | 29 * 613
21719        | 37 * 587
25661        | 67 * 383
29603        | 7 * 4229
33545        | 5 * 6709
37487        | 19 * 1973
41429        | 17 * 2437
45371        | 59 * 769
49313        | 11 * 4483
53255        | 5 * 10651
57197        | 7 * 8171
61139        | 13 * 4703
65081        | 151 * 431
69023        | 23 * 3001
72965        | 5 * 14593

The terms in comma separated form are:

5951, 9893, 13835, 17777, 21719, 25661, 29603, 33545, 37487, 41429, 45371, 49313, 53255, 57197, 61139, 65081, 69023, 72965 

Tuesday, 30 June 2026

Midpoint of the Year

On the 7th August 2021, I made a post title Key Points in the Year and Figure 1 is an extract from that post:


Figure 1

In that post I failed to mention that the exact midpoint of a common or non-leap year occurs at noon on the 2nd of July. As today is June 30th, that point is now not far off. In leap years, the midpoint occurs at midnight on the 2nd of July. This middle day can be written as \( \textbf{20260702} \) using YYYYMMDD format or \( \textbf{2026183} \) using the year and the number of days that have elapsed in it. 

Both formats uniquely define any date but I prefer the latter for the purposes of number analysis. Unfortunately, feeding both of these numbers into my daily number analysis program caused the wheels to spin and the analysis didn't complete. The program handles the five digit numbers associated with my diurnal age but seven and eight digit numbers are too much for my M1 Macbook Air's processor to handle.

However, 2026183 is prime and its reciprocal has a period of 2026182. It forms a twin prime pair with 2026181. It's interesting to consider how many times 183 leads to primes when concatenated with a range of years from 2000 to 2100. Here are the years:

2005, 2006, 2011, 2014, 2015, 2018, 2021, 2023, 2026, 2030, 2041, 2047, 2069, 2093, 2098

Of these, only 2005, 2026 and 2047 form twin prime pairs when both 181 and 183 are concatenated with them.

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.

Thursday, 25 June 2026

Reverse Engineering Part 3

In my previous post, Reverse Engineering Part 2, I ended up being quite satisfied with the reverse engineering that created as output an homogenous linear recurrence relation of order 3 after input of any positive integer greater than 9. I used 28206 and 28207 as examples to illustrate the process.

This got me thinking about creating as output an homogenous linear recurrence relation of order 2 after input of any positive integer greater than 9. I explained in my post Reverse Engineering Part 1 that Gemini's algorithm had failed when attempting this. I was trying to get Gemini to create the following:$$ \begin{align} &\text{a}(n)=p \times \text{a}(n-1)+q \times \text{a}(n-2) \\ &\text{where} -9 \leq p,q \leq 9 \text{ with } p \neq 0 \text{ and } q \neq 0 \\ &\text{ and } 0 \leq \text{a}(n-1), \text{a}(n-2) \leq 9 \end{align}$$So I asked Gemini to relax the conditions by specifying that \( |p + q|\) should be as small as possible. When applied to 28207 this produced values \(p=39\) and \(q=-38\). Not quite what I wanted. So in the end I specified that \(|p^2+q^2+a(0)^2+a(1)^2|\) should be as small as possible. Applied to 28206, this was the result (permalink):

Target Number: 28206
--------------------------------------------------
Constants found: p = 13, q = 1
Constraint check: Minimum p^2 + q^2 + a(0)^2 + a(1)^2 = 395
Seed numbers:    a(0) = 9, a(1) = 12
--------------------------------------------------
Sequence progression:
  a(0) = 9
  a(1) = 12
  a(2) = 165
  a(3) = 2157
  a(4) = 28206
--------------------------------------------------
Comma-separated sequence:
9, 12, 165, 2157, 28206

Applied to 28207, this was the result (permalink):

 Target Number: 28207

--------------------------------------------------
Constants found: p = 6, q = 5
Constraint check: Minimum p^2 + q^2 + a(0)^2 + a(1)^2 = 231
Seed numbers:    a(0) = 11, a(1) = 7
--------------------------------------------------
Sequence progression:
  a(0) = 11
  a(1) = 7
  a(2) = 97
  a(3) = 617
  a(4) = 4187
  a(5) = 28207
--------------------------------------------------
Comma-separated sequence:
11, 7, 97, 617, 4187, 28207

Overall I'm quite happy with these sequences. All terms are positive, the coefficients and seed values are not large and the terms increase steadily toward their targets, avoiding any wild gyrations. I have incorporated this program into my daily number analysis. 

Reverse Engineering Part 2

In my previous post Reverse Engineering Part 1, I had specified to Gemini that I wanted \(p + q + r \) to be the minimum possible within the specifications that each of these coefficients were to be between -9 and -9 inclusive. I was thinking in terms of the sum getting as close to zero as possible forgetting that the minimum possible sum would be -27. That's why I was getting coefficients in the output that were all negative. The algorithm was doing what I'd asked of it! What I should have instructed Gemini to do was to take the absolute value of \(p+q+r\). So to summarise, our starting point is:$$ \begin{align} &\text{a}(n)=p \times \text{a}(n-1)+q \times \text{a}(n-2) + r \times \text{a}(n-2)\\ &\text{with } -9 \leq p,q,r \leq 9, 0 \leq \text{a}(2), \text{a}(1),\text{a}(0) \leq 9 \\ &\text{and } |p+q+r| \text{ as close to zero as possible} \end{align}$$Having gotten Gemini to modify the algorithm, the result for 28206 becomes :$$ \begin{align} &\text{a}(n)=5 \times \text{a}(n-1)-7 \times \text{a}(n-2) + 2 \times \text{a}(n-2)\\ &a(0) = 2, a(1) = 2, a(2) = 6\end{align}$$The full details are (permalink):

Target Number: 28206
------------------------------
Constants found: p = 5, q = -7, r = 2
Constraint check: Minimum |p + q + r| = 0 (Actual Sum = 0)
Seed numbers:    a(0) = 2, a(1) = 2, a(2) = 6
------------------------------
Sequence progression:
  a(0) = 2
  a(1) = 2
  a(2) = 6
  a(3) = 20
  a(4) = 62
  a(5) = 182
  a(6) = 516
  a(7) = 1430
  a(8) = 3902
  a(9) = 10532
  a(10) = 28206
------------------------------
Comma-separated sequence:
2, 2, 6, 20, 62, 182, 516, 1430, 3902, 10532, 28206

This is a longer sequence than previously (2, 4, 2, -48, 408, -3390, 28206) but it has no negative members and is free of the wild gyrations that characterise the former. Similarly for 28207, we have (permalink):$$ \begin{align} &\text{a}(n)=5 \times \text{a}(n-1)+4 \times \text{a}(n-2) -8 \times \text{a}(n-2)\\ &a(0) = 1, a(1) = 1, a(2) = 7\end{align}$$The full results are (permalink):

Target Number: 28207
------------------------------
Constants found: p = 5, q = 4, r = -8
Constraint check: Minimum |p + q + r| = 1 (Actual Sum = 1)
Seed numbers:    a(0) = 1, a(1) = 1, a(2) = 7
------------------------------
Sequence progression:
  a(0) = 1
  a(1) = 1
  a(2) = 7
  a(3) = 31
  a(4) = 175
  a(5) = 943
  a(6) = 5167
  a(7) = 28207
------------------------------
Comma-separated sequence:
1, 1, 7, 31, 175, 943, 5167, 28207

This is shorter than the previously calculated sequence (3, 5, 1, -73, 243, -323, -311, 2207, -3445, -3595, 27729, -51001, -16797, 304365, -658279, 28207) and again it has no negative members and is free of the wild gyrations that characterise the former. So, a lesson learned. I've modified my daily number analysis algorithm accordingly. 

Wednesday, 24 June 2026

Reverse Engineering Part 1

I have a sub-program in my daily number analysis program that will work backwards to find Fibonacci seed numbers that will generate a sequence of terms that leads to my daily number. For example, today I am 28206 days old, and my sub-program generates the following output:

Fibonacci Sequence: Smallest Starting Pair for Target 28206
Starting numbers: a = 126, b = 118
Sequence length to target: 13
Full sequence: [126, 118, 244, 362, 606, 968, 1574, 2542, 4116, 6658, 10774, 17432, 28206]

This can be expressed as:$$ \begin{align} \text{a}(n)=\text{a}(n-1) + \text{a}(n-2)  \\ \text{where } \text{a}(0)=126 \text{ and } \text{a}(1)=118 \end{align}$$These large initial values disturbed me and I wondered if the addition of coefficients \(p\) and \(q\) might reduce the size of the seed numbers required.

I asked Gemini the following:

I would like you to write a program in SageMath that will accept any positive integer \(n > 9\) as input and work backwards to find two seed numbers \( \text{a}(0) \text{ and } \text{a}(1)\) that, combined with constants \(p\) and \(q\), will lead to \(n\) via a Fibonacci-like sequence generated by \( \text{a}(n) = p \times \text{a}(n-1) + q \times \text{a}(n-2)\). The restrictions are that the seed numbers must be between 1 and 9 and the constants \(p\) and \(q\) must also be between -9 and 9.  In the case of more than one combination of constants and seed numbers being found, the criterion is that \(p + q\) should be the minimum possible. The default value for n can be taken as 28206. The program should run in SageMathCell and a Jupyter notebook. The output should show the sequence as it progresses from its starting seed numbers to the final number n. The members of the sequence should also be displayed as comma-separated values.

Unfortunately these restraints proved too restrictive and so I turned to Tribonacci numbers looking for three seed numbers, each between 0 and 9, and three constants \(p, q, r\), each lying between -9 and 9 so that:$$\text{a}(n) = p \times \text{a}(n-1) + q \times \text{a}(n-2) + r \times \text{a}(n-3) $$This proved more productive with Gemini creating the program and producing the following output (permalink):

Target Number: 28206
------------------------------
Constants found: p = -9, q = -6, r = -3
Constraint check: Minimum p + q + r = -18
Seed numbers:    a(0) = 2, a(1) = 4, a(2) = 2
------------------------------
Sequence progression:
  a(0) = 2
  a(1) = 4
  a(2) = 2
  a(3) = -48
  a(4) = 408
  a(5) = -3390
  a(6) = 28206
------------------------------
Comma-separated sequence:
2, 4, 2, -48, 408, -3390, 28206

For me, this is a more satisfactory output with the recursion looking like this: $$ \begin{align} &\text{a}(n) = -9 \times \text{a}(n-1) -6 \times \text{a}(n-2) -3 \times \text{a}(n-3) \\ &\text{with } \text{a}(0)=2, \text{a}(1)=4, \text{a}(2)=2 \end{align}$$What we have here is an homogenous linear recurrence relation of order 3 with coefficients and boundary conditions (seed values) as shown. The sequence is defined by two tuples: the coefficient tuple C and initial value tuple I and written as (C, I). In the example just shown, the representation would be:$$((-9, -6, -3), (2,4,2))$$Let's look at the next number 28207 characterised by ((-4, -9, -8), (3, 5, 1)):

Target Number for Reverse Tribonacci: 28207
------------------------------
Constants found: p = -4, q = -9, r = -8
Constraint check: Minimum p + q + r = -21
Seed numbers:    a(0) = 3, a(1) = 5, a(2) = 1
------------------------------
Sequence progression:
  a(0) = 3
  a(1) = 5
  a(2) = 1
  a(3) = -73
  a(4) = 243
  a(5) = -323
  a(6) = -311
  a(7) = 2207
  a(8) = -3445
  a(9) = -3595
  a(10) = 27729
  a(11) = -51001
  a(12) = -16797
  a(13) = 304365
  a(14) = -658279
  a(15) = 28207
------------------------------
Comma-separated sequence:
3, 5, 1, -73, 243, -323, -311, 2207, -3445, -3595, 27729, -51001, -16797, 304365, -658279, 28207

Figure 1 shows the trajectory of the sequence which begins to fluctuate wildly but the negative by negative multiplication quickly homes in on the target number (28207).

Figure 1

I've now incorporated this information into my daily number analysis.