Tuesday, 28 October 2025

Prime Number Spiral

The number associated with my diurnal age today is a prime number: 27967 and it has the property that it is on the north spoke of a prime number spiral that begins as shown in Figure 1.


Figure 1: source

I thought it might be an interesting challenge for Gemini to write the Python code to generate this spiral up to the largest prime below 40000. To cut a long story short, Gemini failed miserably despite several attempts to improve the code. Grok on the other hand succeeded on its first try although it did time out several times and needed to be reconnected. However, it got the job done and the result is shown in Figure 2 (link to Grok).


Figure 2: code

The formatting is excellent as can be seen in the detail shown in Figure 3 that was taken from Figure 2:


Figure 3: detail from Figure 2

So Gemini proved to be not up to the task despite my persevering with additional prompts whereas Grok succeeded on its first attempt. A lesson learned.

Saturday, 25 October 2025

Prime Factor Fibonacci

A recent number, 27960, associated with my diurnal age has an interesting property if you look at the prime factors more closely:$$27960=2^3 \times 3 \times 5 \times 233$$Let's ignore multiplicity and look at the sum of digits of each distinct prime factor. The 2, 3 and 5 remain the same but 233 becomes 8 and the sequence of prime factors then becomes:$$2, 3, 5, 8$$This is the Fibonacci sequence. How many numbers with four prime factors (ignoring multiplicity) have this property. Well, in the range up to 40000, it turns out that there are 115. These numbers are (permalink):

510, 1020, 1530, 1590, 2040, 2130, 2550, 3060, 3180, 3210, 4080, 4260, 4590, 4770, 5100, 6120, 6360, 6390, 6420, 6990, 7314, 7530, 7650, 7950, 8160, 8520, 8670, 9180, 9540, 9630, 9798, 10200, 10650, 12240, 12720, 12750, 12780, 12840, 12930, 13038, 13770, 13980, 14310, 14628, 14766, 15060, 15090, 15300, 15630, 15900, 16050, 16320, 17040, 17085, 17340, 17466, 18360, 19080, 19170, 19260, 19596, 20400, 20970, 21030, 21300, 21942, 22590, 22950, 23850, 24480, 25440, 25500, 25560, 25680, 25860, 26010, 26076, 26322, 27540, 27960, 28620, 28890, 29256, 29394, 29532, 30120, 30180, 30600, 31260, 31800, 31830, 31950, 32100, 32154, 32637, 32640, 34080, 34530, 34638, 34680, 34932, 34950, 35445, 35511, 36690, 36720, 37650, 38160, 38250, 38340, 38520, 38790, 39114, 39192, 39750

Lets consider the last number in this list: 39750. In this case we have:$$ \begin{align} 39750 &= 2 \times 3 \times 5^3 \times 53 \\ & \rightarrow 2, 3, 5, 8 \end{align}$$If we extend the number of prime factors to five, then only one number satisfies in the range up to 40000:$$ \begin{align}34170 &= 2 \times 3 \times 5 \times 17 \times 67 \\ &\rightarrow 2, 3, 5, 8, 13 \end{align}$$However, there are 160 numbers that satisfy in the range up to one million (permalink). The algorithm actually looks for generalised Fibonacci sequences:$$a,b,c,d,e, \dots \text{ such that } c = a+b, d=b+c, e=c+d \dots$$However, all of the 160 numbers begin with 2. For example, the last of the numbers is 9988520:$$ \begin{align} 998520 &= 2^3 \times 3 \times 5 \times 53 \times 157 \\ &\rightarrow 2, 3, 5, 8, 13 \end{align} $$I tried with six prime factors but without success up to 100 million. Finally I realised that any suitable number must add to 21 and thus be divisible by 3. Such a number can never be a prime factor and so the prime factor sequence must end at 13 and can never progress further.

Sunday, 12 October 2025

A Practical Example of a Convolution

Over the past decade, for some reason, I've chosen to ignore \( \textbf{convolutions} \). Whenever they were mentioned in an OEIS sequence, I simply skipped over the reference. However, I'm now attempting to redress that neglect and to that end I was lucky to find two excellent YouTube videos about convolutions made by 3Blue1Brown (this guy has 7.76 million subscribers and for good reason). The two videos are:

One example of the use of a convolution is that of a weighted die with probabilities of a particular face showing up being given by:
  • p(1) = 0.1
  • p(2) = 0.2
  • p(3) = 0.3
  • p(4) = 0.2
  • p(5) = 0.1
  • p(6) = 0.1
If this die twice is rolled twice, what are the probabilities of throwing a 2, 3, 4, ..., 10, 11, 12? Well, the convolution of the two sequences representing the probabilities of the two dice rolls we tell you. Let's call the sequence A = [0.1, 0.2, 0.3, 0.2, 0.1, 0.1] and the classic way to facilitate the convolution is the so-called "slide and roll". We'll flip A so that it becomes B = [0.1, 0.1, 0.2, 0.3, 0.2, 0.1] and slide B progressively over A. Figure 1 shows the situation for the initial moves.


Figure 1

Of course it would be tedious to have to construct this every time we needed to evaluate a convolution and so Python makes it easier by use of the following code (input in blue, output in red):

A=[0.1,0.2, 0.3, 0.2,0.1,0.1]
result=convolution(A,A)
L=[]
for n in result:
    L.append(numerical_approx(n,digits=2))
print(L)

[0.010, 0.040, 0.10, 0.16, 0.19, 0.18, 0.14, 0.10, 0.050, 0.020, 0.010] 

Reading the output we can see that the probabilities of the various sums are as follows:
  • p(2) = 0.01
  • p(3) = 0.04
  • p(4) = 0.10
  • p(5) = 0.16
  • p(6) = 0.19
  • p(7) = 0.18
  • p(8) = 0,14
  • p(9) = 0.10
  • p(10) = 0.05
  • p(11) = 0.02
  • p(12) = 0.01
Figure 2 shows another view of what's going on. In this case, the various sum are calculated by adding up along the marked diagonals:


Figure 2

This post is simply the first in what I hope will be a series of posts relating to convolutions. As I've already discovered, convolutions linked to Fourier transforms and Laplace transformations so it's a big topic to investigate but at least I've finally made a start.

Thursday, 9 October 2025

Another Prime To Remember

In November of 2024, I created a post titled A Prime To Remember. The prime on that occasion was 27617 and you can read about its properties by following the link. I think it's time to celebrate another prime and that prime is \( \textbf{27947}\). I sometimes struggle to find a single interesting property for the number, on any given day, that is associated with my diurnal age. With 27947 I had no such problem.

First and foremost, it has the property that the sum of its digits, the sum of the squares of its digits and the sum of cubes of its digits are all prime. Thus we have:

  • \(2+7+9+4+7 = 29\) 
  • \(2^2+7^2+9^2+4^2+7^2 = 199\)
  • \(2^3+7^3+9^3+4^3+7^3 = 1487\)
This property affords it membership in OEIS A176179 and there are 322 such numbers in the range up to 40,000. 27947 shares this property with 27617 and so it is included in my blog post A Prime To Remember

27947 also has the property that the absolute differences between successive pairs of digits, and also the first and last digits, are all prime. I discuss these sorts of primes in my blog post titled Fun With Primes and Digit Pairs. Thus we have:
  • \( | 2 - 7 | = 5\)
  • \(| 7 - 9 | = 2\)
  • \(| 9 - 4 | = 5\)
  • \(| 7 - 2 | = 5\)
This property affords it membership in OEIS A087593. This next property relates to the prime producing quadratic polynomial \( (4n-29)^2 + 58 \). This polynomial generates 28 distinct primes in succession from \(n=1\) to \(n=28\). When \(n=49\), the polynomial produces the prime 27947. This property affords it membership of OEIS A320772. See my blog post Another Prime Generating Polynomial.

Still on the subject of primes, 27947 has the property that it is a balanced prime of order 100 and thus a member of OEIS A363168. A prime \(p\) is in this sequence if the sum of the 100 consecutive primes just less than \(p\), plus \(p\), plus the sum of the 100 consecutive primes just greater than \(p\), divided by 201 equals \(p\). In the case of 27947, we have:$$ \begin{align} p_{3050} &= 27947 \\ p_{2950} &= 26891\\ p_{3150} &= 28933\\ \sum_{n=2950}^{3049} p_n &=2742922 \\ \sum_{n=3051}^{3150} p_n &= 2846478 \\ \text{average } &= \frac{ 2742922+27947 + 2846478}{201} \\ &= 27947 \end{align}$$See my blog post titled Varieties of Balanced Primes.

Tuesday, 7 October 2025

Extending Fibonacci-like Numbers

I noticed that in an earlier post titled Consolidating Fibonacci-like Numbers, I looked at numbers like 21347 where we have 2 + 1 = 3 and 3 + 4 = 7 from left to right and even 21101 where 1 + 0 = 1,  0 + 1 = 1 and 1 + 1 = 2 from right to left. In these I only considered additions that resulted in a sums that resulted in a single digit. In this system, a recent diurnal age number (27916) would be ignored and yet 2 + 7 = 9 and 9 + 7 = 16 really does qualify as a Fibonacci-like number.

For this reason I developed an algorithm (permalink) that returns all five digit numbers that follow a Fibonacci-like sequence that will include numbers like 21347 and 27916. Only 28 numbers qualify and these are:

10112, 11235, 12358, 15611, 16713, 17815, 18917, 20224, 21347, 24610, 25712, 26814, 27916, 30336, 31459, 34711, 35813, 36915, 40448, 43710, 44812, 45914, 53811, 54913, 62810, 63912, 72911, 81910

The sequence starts with 10112, 11235, 12358 but then jumps to 15611. What happened to the numbers beginning with 13 and 14? Let's investigate. 

1 + 3 --> 4 and so we have 134
3 + 4 --> 7 and so we have 1347
4 + 7 --> 11 and so we have 134711

However, this is a six digit number and only five digit numbers are being considered. The same holds for the number beginning with 15.

We can reverse the order and reckon from right to left instead of left to right. In this case, we get another 28 numbers. They are (permalink):

10642, 10734, 10826, 10918, 11651, 11743, 11835, 11927, 12752, 12844, 12936, 13761, 13853, 13945, 14862, 14954, 15871, 15963, 16972, 17981, 21101, 42202, 53211, 63303, 74312, 84404, 85321, 95413

If we multiply the digits from left to right (excluding any initial zeroes), we have 15 numbers that satisfy. These are (permalink):

11111, 12248, 14416, 15525, 16636, 17749, 18864, 19981, 21224, 23618, 24832, 31339, 32612, 33927, 42816

If we multiply the digits from right to left (excluding any initial zeroes), we also have 15 numbers that satisfy (permalink):

11111, 12623, 16441, 16824, 18632, 25551, 27933, 32842, 36661, 42212, 49771, 64881, 81991, 84221, 93313

Saturday, 4 October 2025

Solve For X

Here's an interesting little problem. The first time I saw it, I immediately thought Lambert W function and indeed that will yield the two real solutions but there is a simpler way to find one of the solutions. The following is taken from the Mind Your Decisions YouTube channel and I'm including the content here to practise my LaTeX skills and help consolidate what I learnt from the video. Here it is:$$ \begin{align} 3^x &= x^9 \\ (3^{x})^{1/9x} &= (x^{9})^{1/9x} \\ 3^{1/9} &= x^{1/x} \\ ({3^3})^{1/27} &= x^{1/x} \\ 27^{1/27} &= x^{1/x} \\ x &=27 \end{align}$$Quite a neat little trick but there are two solutions so how to we find the other one? That's where the Lambert W function comes in handy.$$ \begin{align} 3^x &= x^9 \\ e^{\ln{3^x}} &= x^9 \\ e^{x \ln{3}} &= x^9 \\ 1 &= \frac{x^9}{e^{x \ln{3}}} \\ 1 &= x^9 e^{-x \ln{3}} \\   (1)^{1/9} &= (x^9 e^{-x \ln{3}})^{1/9} \\ 1 &=xe^{(-x \ln{3})/9} \\ \frac{-\ln{3}}{9} &= x  \Big (\frac{-\ln{3}}{9}\Big ) e^{(-x \ln{3})/9} \\  W \Big (\frac{-\ln{3}}{9} \Big)&= W \Big (x \Big (\frac{-\ln{3}}{9} \Big) e^{(-x \ln{3})/9} \Big ) \\  W \Big (\frac{-\ln{3}}{9} \Big ) &= -(x \ln{3})/9 \\  \frac{-9}{\ln{3} }W \Big (\frac{-\ln{3}}{9} \Big ) &=x  \\ x_1 &= \frac{-9}{\ln{3} }W_{-1} \Big (\frac{-\ln{3}}{9} \Big )  = 27 \\ x_2 &= \frac{-9}{\ln{3} }W_{0} \Big (\frac{-\ln{3}}{9} \Big ) \approx 1.15 \end{align}$$The syntax for evaluation of the above in WolframAlpha uses \( \textbf{productlog} \) instead of W and goes like this:
  • -9/ln 3 * productlog(-1, -ln(3)/9)
  • -9/ln 3 * productlog(0, -ln(3)/9)
Because \( -\ln(3)/9 \approx -0.122 \), this is why we get two solutions. See Figure 1.


Figure 1: graph of \(x=y \, e^y\) and \(x=-\ln(3)/9\)
with intercepts A and B

Primes Within Transcendental Numbers

One of the properties of the number associated with my diurnal age today, 27943, is that it is a prime formed by merging five successive digits in the decimal expansion of \(e \). Primes with this property form OEIS A104846. This got me thinking about whether all possible primes could be expressed by merging successive digits in the decimal expansions of all transcendental numbers like \(e\) and \( \pi \).  

However, as Grok explained:

No, it cannot be proven that the decimal expansions of transcendental numbers like \( \pi \) or \(e\) contain representations of all prime numbers through progressive concatenations of consecutive digits. This interpretation hinges on whether every possible finite sequence of digits—including the decimal representations of all primes—appears as a substring somewhere in their infinite, non-repeating expansions. While this would be true if \( \pi \) and \(e\) are normal numbers (where every digit sequence of length \(k\) appears with equal frequency \(1/10^k\) in the limit), the normality of \( \pi \) and \(e\) remains an open problem in mathematics. 

If numbers like \( \pi \) and \(e\) could be proven to be normal then not only would every prime occur but it would occur an infinite number of times. It's interesting to look at 27943 and see how many times it appears in the first million digits of \(e\). Here are the initial positions for the "2" (permalink):

166, 46606, 217029, 234391, 248347, 258504, 483659, 832027, 941722

For \( \pi \), it takes a while before the first occurrence but afterwards the occurrences of 27943 are more frequent (permalink):

94943, 146738, 216793, 253032, 283291, 290571, 302660, 350882, 358637, 520562, 632389, 661691, 715324, 805161, 843112, 890626

I wondered if there was any difference between algebraic numbers like \( \phi \), the golden ratio, and transcendental numbers in regards to being able to represent all primes as concatenations of successive digits. Here's was Grok's response:

No, it cannot be proven that the decimal expansions of algebraic irrational numbers like the golden ratio (\( \phi  \approx 1.6180339887 \dots \)) contain representations of all prime numbers through progressive concatenations of consecutive digits, for essentially the same reasons as with transcendentals like \( \pi \) and \(e\). Their normality in base 10 remains unproven. 

Just as with Ï€ and e, the golden ratio's decimal expansion is infinite and non-repeating (since it's irrational), but this doesn't guarantee it contains all sequences. Empirical checks of millions of digits suggest randomness consistent with normality, but no proof exists—not even that all digits 0-9 appear infinitely often. It's widely conjectured that φ (a quadratic irrational algebraic number) is normal in base 10, mirroring beliefs about Ï€ and e. Proving this would be a major result in number theory.

There's a specific conjecture (dating back to Borel in 1909, refined later) that every irrational algebraic number is absolutely normal (normal in every integer base \(\geq 2)\). This includes \( \phi, \sqrt{2}, \sqrt{3} \), and others. No counterexamples exist, but crucially, no irrational algebraic has ever been proven normal in any base. In contrast, for transcendentals, normality isn't conjectured for all—only for certain "natural" ones like \( \phi \) and \(e\)—while many non-normal transcendentals are known (e.g., Liouville numbers designed to lack certain digits). 

Proven examples: We have constructed transcendentals proven to be normal, such as Champernowne's constant ( 0.123456789101112 ...)  or the Copeland–ErdÅ‘s constant (formed by concatenating primes: 0.235711131719... ). These do contain every finite digit sequence infinitely often, including all primes. No such proven-normal algebraic irrationals exist, partly because algebraics satisfy polynomial equations, which might impose subtle constraints on their expansions (though the conjecture suggests not). 

In summary, algebraic irrationals like \( \phi \) aren't fundamentally "different" in the sense that the core question—whether all primes appear as substrings—remains unproven and conjectured true, just like for \( \phi\) and \(e\). The main distinction lies in the broader landscape: Algebraics have a stronger universal conjecture without exceptions or proven cases, while transcendentals show a mix of proven normal and non-normal examples. If the conjectures hold, then yes, \( \phi \)'s expansion would contain all primes, but we can't prove it yet.

So at what positions does the prime 27943 appear in the decimal expansion of \( \phi \). Here are the locations (permalink):

33280, 127164, 129935, 529433, 597796, 795399, 971620

Wednesday, 1 October 2025

Which is Larger?


The question was posed in a YouTube video as to which was larger: \(3.14^{\pi}\) or \( \pi^{3.14}\) ? The use of a calculator was not allowed. The solution provided in the video is interesting.$$ \begin{align} &3.14^{\pi} \text{ versus } \pi^{3.14} \\ &\text{raise each to the } 1/3.14 \text{ power} \\ &3.14^{\pi /3.14} \text{ versus } \pi^{3.14/3.14} \\ &3.14^{\pi/3.14} \text{ versus } \pi  \\ & \text{raise each to the } 1/ \pi \text{ power}  \\ &3.14^{\pi/(3.14 \pi)} \text{ versus } \pi ^{1/\pi} \\   &3.14^{1/3.14} \text{ versus } \pi ^{1/\pi} \end{align} $$Now consider the function \(y=x^{1/x}\) which we will modify as follows:$$ \begin{align} y &=x^{1/x} \\ &= e^{\ln{x^{1/x}}} \\ &=e^{1/x \ln{x}} \end{align}$$Let's find its first derivative in order to determine stationary values:$$ \begin{align} \frac{dy}{dx} &=e^{1/x \ln{x}} \frac{d}{dx} (1/x \ln{x})\\ &= \frac{e^{1/x \ln{x}}}{x^2}(1-\ln{x})  \end{align} $$the numerator and denominator on the left are always positive so it comes down to:$$ \begin{align} 1-\ln{x} = 0  \text{ when } x=e \\  \\ \text{if } x<e, dy/dx > 0 \text{ and if } x>e, dy/dx < 0 \end{align}$$Thus there is a maximum turning point at \(x=e\) and since, after this point, \(y\) decreases as \(x\) increases, we must have:$$3.14^{1/3.14} > \pi^{1/\pi} \text{ since } 3.14 < \pi$$This in turn means that by reversing our original transformation, we have:$$3.14^{\pi} > \pi^{3.14}$$Figure 1 shows what the graph of \(y=x^{1/x}\) look like.


Figure 1: note the gradual descent as \(x\) gets larger

The approximate values of our two expressions are as follows:$$ \begin{align} 3.14^{\pi}&\approx 36.4041195357888 \\ \pi^{3.14} &\approx 36.3957438848941 \end{align}$$The solution to this problem also settles the more general issues surrounding when \(a^b\) is larger or smaller than \(b^a\) with \(a,b>1\). Let's consider the problem of:$$a^b \text{ versus } b^a \text{ for the particular case of }2024^{2025} \text{ versus } 2025^{2004}$$We know from earlier that this comparison reduces to:$$ \begin{align} &a^{1/a} \text{ versus } b^{1/b} \text{ or } 2024^{1/2024} \text{ versus } 2025^{1/2005} \\  &\text{and if }a>e, b>e \text{ and } a<b \text{ then:} \\ &\text{because } 2024 < 2025 \text{ we have:}\\ &2024^{2025} > 2025^{2004} \end{align} $$ However, what about:$$ \phi^{1.618} \text{ versus } 1.618^{\phi}$$Here the problem reduces to:$$\phi^{1/\phi} \text{ versus } 1.618^{1/1.618}$$Here \(\phi<e\) and \(1.618<e\) and \(1.618 < \phi\), so:$$ 1.618^{1/1.618} < \phi ^{1/\phi} \text{ and } 1.618^{\phi}<\phi^{1.618}$$Double checking we find that:$$ \begin{align} 1.618^{\phi} \approx 2.17838352536880\\ \phi^{1.618} \approx 2.17842193783803 \end{align}$$If the values of \(a\) and \(b\) fall on either side of \(e\) then the previous methods don't work. I'll leave this problem for another post possibly as I've spent enough time on this.

Tuesday, 23 September 2025

Obscure Difference of Two Squares

 Here's an interesting problem that appeared in this YouTube video:

Find the values of \(a, b \in \mathbb{N}\) such \(a^b-b=77\).

With two unknowns and only one equation, the problem seems daunting but the factorisation of 77 and the fact that the values of \(a\) and \(b\) are restricted to natural numbers will be enough to solve the problem. However, the solution that the video describes hinges on the use of a difference of two squares and this is not at all obvious. Let's begin:$$ \begin{align} a^b-b &= 77 \\ (a^{b/2})^2-(\sqrt{b})^2 &= 77 \\ (a^{b/2}-\sqrt{b}) \times  (a^{b/2}+\sqrt{b}) &= 7 \times 11 \end{align} $$We know that \(a^{b/2}-\sqrt{b} < a^{b/2}+\sqrt{b}\) and so there are only two possible factorisations of 77. These are \(1 \times 77\) and \(7 \times 11 \). Not only is the second option more likely but the first option in fact does not yield a solution, as we'll show later. Let's proceed using the \(7 \times 11\) factorisation.$$ \begin{align} a^{b/2}-\sqrt{b} &=7 \dots 1\\ a^{b/2}+\sqrt{b} &=11 \dots 2 \end{align}$$Adding equations 1 and 2 together gives:$$ \begin{align} 2 a^{b/2} &=18 \\ a^{b/2} &=9 \\ \end{align}$$Let's substitute \(a^{b/2}=9\) back in the equation 1:$$ \begin{align} 9 - \sqrt{b} &= 7 \\ \sqrt{b} &= 2 \\ b &=4 \\ \because a^{b/2} &= 9 \\ a^2 &= 9 \\ a&=3 \end{align}$$So we have a solution with \(a = 3\) and \(b=4\). Substituting these values back into the original equation should confirm the solution:$$ \begin{align} a^b -b &= 77 \\ 3^4-4 &=77\\77 &= 77 \end{align}$$But what of the \(1 \times 77\) factorisation? Let's confirm that this does not yield a solution:$$ \begin{align} a^{b/2}-\sqrt{b} &=1 \dots 1\\ a^{b/2}+\sqrt{b} &=77 \dots 2 \end{align}$$Adding equations 1 and 2 together gives$$ \begin{align} 2a^{b/2} &=78\\ a^{b/2} &= 39 \end{align}$$Substitute \(a^{b/2}=39\) back in the equation 1:$$ \begin{align} 39 - \sqrt{b} &=77 \\ \sqrt{b}=-38 \end{align}$$There is no value of \(b\) that satisfies this equation so we can confirm that the \(1 \times 77\) factorisation does not yield a solution. I did not think up the method of solution described here and all credit is due the author of the linked video. It did occur to me to generalise the problem and consider what other biprimes (or semiprimes) yield a solution. In other words, what prime values of \(x\) and \(y\), with \(x<y\), allow for natural number solutions to:$$a^b-b=xy$$The two equations we obtain from this relationship are:$$ \begin{align} a^{b/2}-\sqrt{b} &=x \dots 1\\ a^{b/2}+\sqrt{b} &=y \dots 2 \end{align}$$Adding equations 1 and 2 gives:$$ \begin{align} 2a^{b/2} &= x+y \\ a^{b/2} &= \frac{x+y}{2} \end{align}$$Substituting into equation 1 gives:$$ \begin{align} \frac{x+y}{2}-\sqrt{b} &= x \\ \sqrt{b} &= \frac{x+y}{2}-x \\ \sqrt{b} &= \frac{x+y-2x}{2} \\ b &= \frac{(y-x)^2}{4}  \end{align}$$Testing this equation with \(x=7\) and \(y=11\) we see that \(b=4\) and so all is well. So what other prime values of \(x\) and \(y\) will yield solutions? Testing we find that \(x=3\) and \(y=5\) yield a value of \(b=1\). This leads to:$$ \begin{align} a^{b/2} &=\frac{x+y}{2}\\ \sqrt{a} &= 4 \\ a &=16 \end{align}$$Checking, we see that:$$ \begin{align} a^b-b &=15 \\ 16^1-1 &=15\\15 &= 15 \end{align}$$Rather than randomly checking prime values of \(x\) and \(y\), the design of a search algorithm is a more organised approach (permalink). Let's exclude those cases where either \(a=1\) or \(b=1\) as these are rather trivial. For semiprimes with prime factors less than 300, I found the following additional semiprimes (the calculations are very processor intenstive). The first is 6557:$$ \begin{align} 6557 &=79 \times 83 \\ \text{with } a &= 9 \text{ and }b= 4 \end{align}$$Checking, we find that:$$ \begin{align} a^b-b &= 6557 \\9^4 - 4 &= 6557 \\ 6561-4  &= 6557\\ 6557&=6557 \end{align}$$The second is 50621:$$ \begin{align} 50621 &=223 \times 227\\ \text{with } a &= 15 \text{ and }b= 4 \end{align}$$Checking, we find that:$$ \begin{align} a^b-b &= 50621 \\ 15^4 - 4 &= 50621\\50625-4 &= 50621\\50621 &= 50621 \end{align}$$The third is 194477:$$ \begin{align} 194477 &=439 \times 443 \\ \text{with } a &= 21 \text{ and } b=4 \end{align}$$Checking, we find that:$$ \begin{align} a^b-b &= 194477 \\ 21^4-4 &= 194477 \\ 194481-4 &= 194477 \\ 194477 &= 194477 \end{align}$$That's probably enough. As can be seen, the semiprimes that satisfy are few and far between but it was an interesting exercise. Notice that the prime factors in each case are adjacent primes.

Sunday, 21 September 2025

Truncated Pyramid

I was surprised to discover that the number associated with my diurnal age today (27930) has a connection to the volume of a truncated square pyramids. Firstly, let's recall the formula for the volume of such figure:$$V=\frac{1}{3} (a^2+ab+b^2) \, h$$where \(a\) is the side length of the square base, \(b\) is the side length of the top square and \(h\) is the height of the truncated pyramid. The formula is easily confirmed by integration from first principles without relying on the formula for the volume of a pyramid. 

Now 27930 is a member of OEIS A027444: \( \text{a}(n) = n^3 + n^2 + n\) with the following interesting comment attached to the entry:

For \(n>1\), a(\(n\)) is the volume of a truncated square pyramid with height \(n\) and base  lengths \(n+2\) and \(n-1\). See Figure 1.


Figure 1

Now if we substitute \(a=n+2\), \(b=n-1\) and \(n=h\) into our earlier formula we find the volume \(V\) of the truncated pyramid becomes:$$V=n^3+n^2+n$$When \(n=30\), the volume is 27930 cubic units. Here are the volumes for various values of \(n>1\):

  n    n-1   n+2   V 
 
  2    1     4     14
  3    2     5     39
  4    3     6     84
  5    4     7     155
  6    5     8     258
  7    6     9     399
  8    7     10    584
  9    8     11    819
  10   9     12    1110
  11   10    13    1463
  12   11    14    1884
  13   12    15    2379
  14   13    16    2954
  15   14    17    3615
  16   15    18    4368
  17   16    19    5219
  18   17    20    6174
  19   18    21    7239
  20   19    22    8420
  21   20    23    9723
  22   21    24    11154
  23   22    25    12719
  24   23    26    14424
  25   24    27    16275
  26   25    28    18278
  27   26    29    20439
  28   27    30    22764
  29   28    31    25259
  30   29    32    27930
  31   30    33    30783
  32   31    34    33824
  33   32    35    37059

Saturday, 20 September 2025

Seven Eleven Rules

I was struggling to find something that caught my fancy regarding the number associated with my diurnal age today: 27929. I thought I'd look at its reverse, 92972, and compare their factorisations. The results were:$$ \begin{align} 27929 =  11 \times 2539 \\ 92972 ==2^2 \times 11 \times 2113$$Clearly, the number and its reverse share a common prime factor of 11. I then realised that 27929 has a digit sum of 29 and the two digits, when added together, give 11. So I then decided to look for numbers with the following properties:

  • number is divisible by 11
  • its reverse is also divisible by 11
  • its sum of digits gives a number whose digits sum to 11
It turns out that there are only 30 numbers that satisfy these criteria in the range up to 40000. They are:

20999, 21989, 22979, 23969, 24959, 25949, 26939, 27929, 28919, 29909, 30899, 30998, 31889, 31988, 32879, 32978, 33869, 33968, 34859, 34958, 35849, 35948, 36839, 36938, 37829, 37928, 38819, 38918, 39809, 39908

The details are (permalink):

  number   factors              reverse   factors              digit sum   sum

  20999    11 * 23 * 83         99902     2 * 11 * 19 * 239    29          11
  21989    11 * 1999            98912     2^5 * 11 * 281       29          11
  22979    11 * 2089            97922     2 * 11 * 4451        29          11
  23969    11 * 2179            96932     2^2 * 11 * 2203      29          11
  24959    11 * 2269            95942     2 * 7^2 * 11 * 89    29          11
  25949    7 * 11 * 337         94952     2^3 * 11 * 13 * 83   29          11
  26939    11 * 31 * 79         93962     2 * 11 * 4271        29          11
  27929    11 * 2539            92972     2^2 * 11 * 2113      29          11
  28919    11^2 * 239           91982     2 * 11 * 37 * 113    29          11
  29909    11 * 2719            90992     2^4 * 11^2 * 47      29          11
  30899    11 * 53^2            99803     11 * 43 * 211        29          11
  30998    2 * 11 * 1409        89903     11^2 * 743           29          11
  31889    11 * 13 * 223        98813     11 * 13 * 691        29          11
  31988    2^2 * 11 * 727       88913     11 * 59 * 137        29          11
  32879    7^2 * 11 * 61        97823     11 * 8893            29          11
  32978    2 * 11 * 1499        87923     11 * 7993            29          11
  33869    11 * 3079            96833     11 * 8803            29          11
  33968    2^4 * 11 * 193       86933     7 * 11 * 1129        29          11
  34859    11 * 3169            95843     11 * 8713            29          11
  34958    2 * 7 * 11 * 227     85943     11 * 13 * 601        29          11
  35849    11 * 3259            94853     11 * 8623            29          11
  35948    2^2 * 11 * 19 * 43   84953     11 * 7723            29          11
  36839    11 * 17 * 197        93863     7 * 11 * 23 * 53     29          11
  36938    2 * 11 * 23 * 73     83963     11 * 17 * 449        29          11
  37829    11 * 19 * 181        92873     11 * 8443            29          11
  37928    2^3 * 11 * 431       82973     11 * 19 * 397        29          11
  38819    11 * 3529            91883     11 * 8353            29          11
  38918    2 * 11 * 29 * 61     81983     11 * 29 * 257        29          11
  39809    7 * 11^2 * 47        90893     11 * 8263            29          11
  39908    2^2 * 11 * 907       80993     11 * 37 * 199        29          11


The algorithm can be modified to search for prime numbers other than 11. For example, there are 80 numbers in the range up to 40000 that satisfy these criteria:
  • number is divisible by 7
  • its reverse is also divisible by 7
  • its sum of digits gives a number whose digits sum to 7
These numbers are (permalink):

259, 952, 1078, 1708, 2527, 2779, 3346, 3598, 4165, 5614, 5866, 6433, 6685, 7252, 8071, 8701, 8953, 9079, 9709, 9772, 10087, 10717, 10969, 11536, 11788, 12103, 12355, 13174, 13804, 14623, 14875, 15442, 15694, 17017, 17269, 17962, 18088, 18718, 19537, 19789, 20545, 20797, 21364, 22183, 22813, 23884, 24451, 25207, 25459, 26026, 26278, 26908, 26971, 27097, 27727, 27979, 28546, 28798, 29113, 29365, 30121, 30373, 31129, 31192, 31822, 32641, 32893, 33649, 34216, 34468, 35035, 35287, 35917, 36736, 36988, 37303, 37555, 38122, 38374, 39823

The details are (permalink):

  number   factors             reverse   factors                digit sum   sum

  259      7 * 37              952       2^3 * 7 * 17           16          7
  952      2^3 * 7 * 17        259       7 * 37                 16          7
  1078     2 * 7^2 * 11        8701      7 * 11 * 113           16          7
  1708     2^2 * 7 * 61        8071      7 * 1153               16          7
  2527     7 * 19^2            7252      2^2 * 7^2 * 37         16          7
  2779     7 * 397             9772      2^2 * 7 * 349          25          7
  3346     2 * 7 * 239         6433      7 * 919                16          7
  3598     2 * 7 * 257         8953      7 * 1279               25          7
  4165     5 * 7^2 * 17        5614      2 * 7 * 401            16          7
  5614     2 * 7 * 401         4165      5 * 7^2 * 17           16          7
  5866     2 * 7 * 419         6685      5 * 7 * 191            25          7
  6433     7 * 919             3346      2 * 7 * 239            16          7
  6685     5 * 7 * 191         5866      2 * 7 * 419            25          7
  7252     2^2 * 7^2 * 37      2527      7 * 19^2               16          7
  8071     7 * 1153            1708      2^2 * 7 * 61           16          7
  8701     7 * 11 * 113        1078      2 * 7^2 * 11           16          7
  8953     7 * 1279            3598      2 * 7 * 257            25          7
  9079     7 * 1297            9709      7 * 19 * 73            25          7
  9709     7 * 19 * 73         9079      7 * 1297               25          7
  9772     2^2 * 7 * 349       2779      7 * 397                25          7
  10087    7 * 11 * 131        78001     7 * 11 * 1013          16          7
  10717    7 * 1531            71701     7 * 10243              16          7
  10969    7 * 1567            96901     7 * 109 * 127          25          7
  11536    2^4 * 7 * 103       63511     7 * 43 * 211           16          7
  11788    2^2 * 7 * 421       88711     7 * 19 * 23 * 29       25          7
  12103    7^2 * 13 * 19       30121     7 * 13 * 331           7           7
  12355    5 * 7 * 353         55321     7^2 * 1129             16          7
  13174    2 * 7 * 941         47131     7 * 6733               16          7
  13804    2^2 * 7 * 17 * 29   40831     7 * 19 * 307           16          7
  14623    7 * 2089            32641     7 * 4663               16          7
  14875    5^3 * 7 * 17        57841     7 * 8263               25          7
  15442    2 * 7 * 1103        24451     7^2 * 499              16          7
  15694    2 * 7 * 19 * 59     49651     7 * 41 * 173           25          7
  17017    7 * 11 * 13 * 17    71071     7 * 11 * 13 * 71       16          7
  17269    7 * 2467            96271     7 * 17 * 809           25          7
  17962    2 * 7 * 1283        26971     7 * 3853               25          7
  18088    2^3 * 7 * 17 * 19   88081     7 * 12583              25          7
  18718    2 * 7^2 * 191       81781     7^2 * 1669             25          7
  19537    7 * 2791            73591     7 * 10513              25          7
  19789    7 * 11 * 257        98791     7 * 11 * 1283          34          7
  20545    5 * 7 * 587         54502     2 * 7 * 17 * 229       16          7
  20797    7 * 2971            79702     2 * 7 * 5693           25          7
  21364    2^2 * 7^2 * 109     46312     2^3 * 7 * 827          16          7
  22183    7 * 3169            38122     2 * 7^2 * 389          16          7
  22813    7 * 3259            31822     2 * 7 * 2273           16          7
  23884    2^2 * 7 * 853       48832     2^6 * 7 * 109          25          7
  24451    7^2 * 499           15442     2 * 7 * 1103           16          7
  25207    7 * 13 * 277        70252     2^2 * 7 * 13 * 193     16          7
  25459    7 * 3637            95452     2^2 * 7^2 * 487        25          7
  26026    2 * 7 * 11 * 13^2   62062     2 * 7 * 11 * 13 * 31   16          7
  26278    2 * 7 * 1877        87262     2 * 7 * 23 * 271       25          7
  26908    2^2 * 7 * 31^2      80962     2 * 7 * 5783           25          7
  26971    7 * 3853            17962     2 * 7 * 1283           25          7
  27097    7^3 * 79            79072     2^5 * 7 * 353          25          7
  27727    7 * 17 * 233        72772     2^2 * 7 * 23 * 113     25          7
  27979    7^2 * 571           97972     2^2 * 7 * 3499         34          7
  28546    2 * 7 * 2039        64582     2 * 7^2 * 659          25          7
  28798    2 * 7 * 11^2 * 17   89782     2 * 7 * 11^2 * 53      34          7
  29113    7 * 4159            31192     2^3 * 7 * 557          16          7
  29365    5 * 7 * 839         56392     2^3 * 7 * 19 * 53      25          7
  30121    7 * 13 * 331        12103     7^2 * 13 * 19          7           7
  30373    7 * 4339            37303     7 * 73^2               16          7
  31129    7 * 4447            92113     7 * 13159              16          7
  31192    2^3 * 7 * 557       29113     7 * 4159               16          7
  31822    2 * 7 * 2273        22813     7 * 3259               16          7
  32641    7 * 4663            14623     7 * 2089               16          7
  32893    7 * 37 * 127        39823     7 * 5689               25          7
  33649    7 * 11 * 19 * 23    94633     7 * 11 * 1229          25          7
  34216    2^3 * 7 * 13 * 47   61243     7 * 13 * 673           16          7
  34468    2^2 * 7 * 1231      86443     7 * 53 * 233           25          7
  35035    5 * 7^2 * 11 * 13   53053     7 * 11 * 13 * 53       16          7
  35287    7 * 71^2            78253     7^2 * 1597             25          7
  35917    7^2 * 733           71953     7 * 19 * 541           25          7
  36736    2^7 * 7 * 41        63763     7 * 9109               25          7
  36988    2^2 * 7 * 1321      88963     7 * 71 * 179           34          7
  37303    7 * 73^2            30373     7 * 4339               16          7
  37555    5 * 7 * 29 * 37     55573     7 * 17 * 467           25          7
  38122    2 * 7^2 * 389       22183     7 * 3169               16          7
  38374    2 * 7 * 2741        47383     7^2 * 967              25          7
  39823    7 * 5689            32893     7 * 37 * 127           25          7

Wednesday, 17 September 2025

Some Interesting Properties of 39

My daughter-in-law turned 39 yesterday and so I was prompted to investigate some of its mathematical properties. One of its properties is its membership in OEIS A055233:


A055233: composite numbers equal to the sum of the primes from their smallest prime factor to their largest prime factor.

The only members of this sequence in the range up to 40000 are 10, 39, 155 and 371. All are semiprimes and factorise as follows:

  • \(10 = 2 \times 5 \text{ with } 2 + 3 + 5 = 10 \)
  • \(39 = 3 \times 13 \text{ with } 3 + 5 + 7 + 11+13 = 39\)
  • \(155 = 5 \times 31 \text{ with } 5 + 7 + \ldots + 29 + 31=155\)
  • \(371 = 7 \times 53 \text{ with } 7 + 11 + \ldots + 47 + 53=371\)
Because they are semiprimes they are thus equal to the product of their smallest and largest prime factors. However, this is not the case for the next member of the sequence: 2935561623745. The reason is that it is not a semiprime.
  • \(2935561623745= 5 \times 19 \times 53 \times 61 \times 9557887\)

The next member of the sequence 454539357304421 is a semiprime and thus follows the pattern of the first four members of the sequence:
  • \(454539357304421 = 3536123 \times 128541727\)
So we see that 39 by virtue of its membership in OEIS A055233 is rather special. Of course, it has some other interesting qualities. For example, it can be constructed from the first three powers of 3:$$39=3+3^2+3^3$$Gemini also mentions the following number properties:
Beyond these patterns, 39 is also classified as a \( \textbf{Perrin number}\) and a \( \textbf{Størmer number}\), placing it within specialized mathematical sequences that are far from intuitive. 
The number also has an \( \textbf{aliquot sum}\) of 17, which is a prime number, a unique characteristic that links it to a specific aliquot sequence. 
In the realm of number partitions, 39 is notable as the smallest natural number to have three distinct partitions into three parts that all yield the same product, 1200. These partitions are:
  • {25, 8, 6} 
  • {24, 10, 5} 
  • {20, 15, 4}. 
Lastly, in analytic number theory, the \( \textbf{Mertens function}\) returns a value of 0 when given 39, a property that suggests a form of numerical equilibrium or stability, a concept that finds intriguing parallels in other domains. See blog post Zeroes of the Mertens Function.

39 is also what's termed a \( \textbf{perfect totient number} \) because the sum of its iterated totients equals the number itself. Let's confirm this:$$ \begin{align} \phi(39) &=24 \\ \phi(24) &=8 \\ \phi(8) &=4 \\ \phi(4) &=2 \\ \phi(2) &=1 \end{align} $$The sum of these iterated totients equals 39:$$24 + 8 + 4 + 2 + 1 =39$$The perfect totient numbers are listed in OEIS A082897 (permalink):

3, 9, 15, 27, 39, 81, 111, 183, 243, 255, 327, 363, 471, 729, 2187, 2199, 3063, 4359, 4375, 5571, 6561, 8751, 15723, 19683, 36759, 46791, 59049, 65535, 140103, 177147, 208191, 441027, 531441, 1594323, 4190263, 4782969, 9056583, 14348907, 43046721

Tuesday, 16 September 2025

Tricky Entrance Exam Questions

I came across this problem on a YouTube channel. The problem was purported to be a Harvard University entrance exam question.$$ \text{Simplify } \sqrt{\sqrt{121}-\sqrt{120}}$$Once you see the method, it's easy enough so let's start to simplify:$$

\begin{align}

\sqrt{\sqrt{121}-\sqrt{120}} &= \sqrt{11 - 2 \cdot \sqrt{30}} \\

&= \sqrt{11 - 2 \cdot \sqrt{6} \cdot \sqrt{5}} \\

&= \sqrt{6 - 2 \cdot \sqrt{6} \cdot \sqrt{5} + 5} \\

&= \sqrt{(\sqrt{6})^2 - 2 \cdot \sqrt{6} \cdot \sqrt{5} + (\sqrt{5})^2} \\

&= \sqrt{(\sqrt{6} - \sqrt{5})^2} \\

&= \sqrt{6} - \sqrt{5}

\end{align}

$$Here's another one:$$ \text{Simplify } \sqrt{\sqrt{36}-\sqrt{20}}$$The approach is exactly the same:

$$
\begin{align}

\sqrt{\sqrt{36}-\sqrt{20}} &= \sqrt{6 - 2 \cdot \sqrt{5}} \\

&= \sqrt{6- 2 \cdot \sqrt{5} \cdot \sqrt{1}} \\

&= \sqrt{5 - 2 \cdot \sqrt{5} \cdot \sqrt{1} + 1} \\

&= \sqrt{(\sqrt{5})^2 - 2 \cdot \sqrt{5} \cdot \sqrt{1} + (\sqrt{1})^2} \\

&= \sqrt{(\sqrt{5} - \sqrt{1})^2} \\

&= \sqrt{5} - \sqrt{1}\\
&=\sqrt{5}-1

\end{align}

$$

A Special Date

 I came across this article today that discusses today's date: the 16th of September 2025:

Once a century, a very special day comes along. That day is today — 9/16/25.

Pi Day (3/14) often comes with sweet treats; Square Root Day (4/4/16 or 5/5/25, for example) has a certain numerical rhyme. But the particular string of numbers in today's date may be especially delightful to the brains of mathematicians and the casual nerds among us.

First, "all three of the entries in that date are perfect squares — and what I mean by that is \(9\) is equal to \(3^2\), \(16\) is equal to \(4^2\), and \(25\) is equal to \(5^2,\)" says Colin Adams, a mathematician at Williams College who was first tipped off about today's special qualities during a meeting with his former student, Jake Malarkey.

Next, those perfect squares come from consecutive numbers — three, four, and five.

But perhaps most special of all is that three, four, and five are an example of what's called a Pythagorean triple.

"And what that means," explains Adams, "is that if I take the sum of the squares of the first two numbers, \(3^2 + 4^2\), which is \(9 + 16\) is equal to \(25\), which is \(5^2\), so \(3^2 + 4^2 = 5^2\)."

This is the Pythagorean Theorem: \(a^2 + b^2 = c^2\). "And that in fact is the most famous theorem in all of mathematics," says Adams.

It's a theorem that means something geometrically, too. Any Pythagorean triple — including 3, 4, and 5 — also gives the lengths of the three sides of a right triangle. That is, the squares of the two shorter lengths add up to the square of the final, longer side (the hypotenuse).

There are no other dates this century that meet all these conditions, so most of us will experience it just once in our lifetime.

(Fun bonus: It turns out the full year, \(2025\), is also a perfect square: \(45 \times 45\).)

In any case, Adams says that if it were up to him, he'd call the day Pythagorean Triple Square Day. And he plans on celebrating with a rectangular cake cut along the diagonal to yield two right triangles.

"If I have any luck at all, if I can find a cake with the right dimensions, it'll look like a 3, 4, 5 cake, namely edge length 3, edge length 4, and edge length 5," he says. In the middle, he intends to have the date inscribed in icing.

"This date is hiding one of the most beautiful coincidences we will ever encounter," says Terrence Blackman, chair of the mathematics department at Medgar Evers College in the City University of New York. "Those numbers, they tell a story that goes back to ancient Greece."

Blackman says the Pythagorean Theorem is used frequently by carpenters and architects. But for him, as a mathematician, today's date captures a special elegance.

"It reveals some kind of hidden mathematical poetry that is sitting there — just like walking and coming upon a beautiful flower," he says.

In a world that can feel chaotic, Blackman feels that a day like today shows that math can provide a source of comfort.

"It reminds us that beauty and meaning can be found anywhere and everywhere," he says. "We just have to continue to look for it."

Sunday, 14 September 2025

Sequences Involving SOD and POD

The number associated with my diurnal age today, 27923, has the interesting property that its sum of digits (23) is equal to the last two digits of the number. This number is part of a sequence of consecutive numbers that all share this same property. The numbers are 27920 up to 27929. In the range of numbers up to 40000, there are 440 numbers with this property. They are (permalink):

SOD = Concatenation of Last Two Digits

910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 1810, 1811, 1812, 1813, 1814, 1815, 1816, 1817, 1818, 1819, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 3619, 4510, 4511, 4512, 4513, 4514, 4515, 4516, 4517, 4518, 4519, 5410, 5411, 5412, 5413, 5414, 5415, 5416, 5417, 5418, 5419, 6310, 6311, 6312, 6313, 6314, 6315, 6316, 6317, 6318, 6319, 7210, 7211, 7212, 7213, 7214, 7215, 7216, 7217, 7218, 7219, 8110, 8111, 8112, 8113, 8114, 8115, 8116, 8117, 8118, 8119, 9010, 9011, 9012, 9013, 9014, 9015, 9016, 9017, 9018, 9019, 9920, 9921, 9922, 9923, 9924, 9925, 9926, 9927, 9928, 9929, 10810, 10811, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 11710, 11711, 11712, 11713, 11714, 11715, 11716, 11717, 11718, 11719, 12610, 12611, 12612, 12613, 12614, 12615, 12616, 12617, 12618, 12619, 13510, 13511, 13512, 13513, 13514, 13515, 13516, 13517, 13518, 13519, 14410, 14411, 14412, 14413, 14414, 14415, 14416, 14417, 14418, 14419, 15310, 15311, 15312, 15313, 15314, 15315, 15316, 15317, 15318, 15319, 16210, 16211, 16212, 16213, 16214, 16215, 16216, 16217, 16218, 16219, 17110, 17111, 17112, 17113, 17114, 17115, 17116, 17117, 17118, 17119, 18010, 18011, 18012, 18013, 18014, 18015, 18016, 18017, 18018, 18019, 18920, 18921, 18922, 18923, 18924, 18925, 18926, 18927, 18928, 18929, 19820, 19821, 19822, 19823, 19824, 19825, 19826, 19827, 19828, 19829, 20710, 20711, 20712, 20713, 20714, 20715, 20716, 20717, 20718, 20719, 21610, 21611, 21612, 21613, 21614, 21615, 21616, 21617, 21618, 21619, 22510, 22511, 22512, 22513, 22514, 22515, 22516, 22517, 22518, 22519, 23410, 23411, 23412, 23413, 23414, 23415, 23416, 23417, 23418, 23419, 24310, 24311, 24312, 24313, 24314, 24315, 24316, 24317, 24318, 24319, 25210, 25211, 25212, 25213, 25214, 25215, 25216, 25217, 25218, 25219, 26110, 26111, 26112, 26113, 26114, 26115, 26116, 26117, 26118, 26119, 27010, 27011, 27012, 27013, 27014, 27015, 27016, 27017, 27018, 27019, 27920, 27921, 27922, 27923, 27924, 27925, 27926, 27927, 27928, 27929, 28820, 28821, 28822, 28823, 28824, 28825, 28826, 28827, 28828, 28829, 29720, 29721, 29722, 29723, 29724, 29725, 29726, 29727, 29728, 29729, 30610, 30611, 30612, 30613, 30614, 30615, 30616, 30617, 30618, 30619, 31510, 31511, 31512, 31513, 31514, 31515, 31516, 31517, 31518, 31519, 32410, 32411, 32412, 32413, 32414, 32415, 32416, 32417, 32418, 32419, 33310, 33311, 33312, 33313, 33314, 33315, 33316, 33317, 33318, 33319, 34210, 34211, 34212, 34213, 34214, 34215, 34216, 34217, 34218, 34219, 35110, 35111, 35112, 35113, 35114, 35115, 35116, 35117, 35118, 35119, 36010, 36011, 36012, 36013, 36014, 36015, 36016, 36017, 36018, 36019, 36920, 36921, 36922, 36923, 36924, 36925, 36926, 36927, 36928, 36929, 37820, 37821, 37822, 37823, 37824, 37825, 37826, 37827, 37828, 37829, 38720, 38721, 38722, 38723, 38724, 38725, 38726, 38727, 38728, 38729, 39620, 39621, 39622, 39623, 39624, 39625, 39626, 39627, 39628, 39629

A plot of these numbers shows a quite regular pattern. See Figure 1.


Figure 1: permalink

Addendum: I noticed that OEIS A052018: numbers \(k\) with the property that the sum of the digits of \(k\) is a substring of \(k\) is a more general version of what I've just described.

If we consider the product of digits instead and exclude numbers with the digit 0, then only 31 numbers satisfy in the range up to 40000. These are (permalink):

POD = Concatenation of Last Two Digits

236, 315, 324, 612, 1236, 1315, 1324, 1612, 2136, 2312, 3115, 3124, 3212, 6112, 11236, 11315, 11324, 11612, 12136, 12312, 13115, 13124, 13212, 16112, 21136, 21312, 23112, 31115, 31124, 31212, 32112

Figure 2 shows a graph of these numbers.


Figure 2: permalink

Thursday, 11 September 2025

Even Numbers as Sums of Three Pronic Numbers

I saw this problem mentioned in a post on math.stackexchange.com:

See if you can prove that every even number is the sum of three pronic numbers (if needed, we say 0 is also pronic) 

I put the problem to Gemini and got the response that "it's impossible to prove that every even number is the sum of three pronic numbers". I wasn't convinced so I consulted Grok. Here was its response.

Every even non-negative integer can indeed be expressed as the sum of three pronic numbers, where pronic numbers are of the form \(n(n+1)\) for non-negative integers \(n \geq 0\) (thus including 0 as the pronic number for \(n=0\)).

To prove this, first recall that a pronic number \(p_n = n(n+1) = 2 \cdot T_n\), where \(T_n = \frac{n(n+1)}{2}\) is the \(n\)th triangular number (with \(T_0 = 0\)). Let \(E\) be an arbitrary even non-negative integer, so \(E = 2m\) for some non-negative integer \(m\). The claim is equivalent to showing that every non-negative integer \(m\) can be written as the sum of three triangular numbers: \(m = T_a + T_b + T_c\) for some non-negative integers \(a, b, c\). This is a known theorem (attributed to Gauss): every non-negative integer is the sum of at most three triangular numbers. The proof relies on a connection to the three squares theorem and modular arithmetic, as follows. Step 1: Relate triangular numbers to squares.
Observe that \(8T_n + 1 = (2n + 1)^2\). Thus, every number of the form \(8T_n + 1\) is an odd perfect square, and conversely, every odd perfect square is of this form for some \(n\). Step 2: Reformulate the problem.

Suppose \(m = T_a + T_b + T_c\). Multiplying by 8 and adding 3 gives:$$ \begin{align} 8m + 3 &= (8T_a + 1) + (8T_b + 1) + (8T_c + 1) \\ &= (2a + 1)^2 + (2b + 1)^2 + (2c + 1)^2 \end{align} $$so \(8m + 3\) is the sum of three odd squares. The converse also holds: if \(8m + 3\) is the sum of three odd squares, then \(m\) is the sum of three triangular numbers.
Thus, it suffices to show that every number of the form \(8m + 3\) (for \(m \geq 0\)) is the sum of three odd squares. Step 3: Use the three squares theorem
Legendre's three squares theorem states that a positive integer can be expressed as the sum of three squares if and only if it is not of the form \(4^k(8l + 7)\) for non-negative integers \(k, l\). Numbers of the form \(8m + 3\) are congruent to 3 modulo 8. Check if such numbers can be of the forbidden form \(4^k(8l + 7)\):
  • For \(k = 0\): \(8l + 7 \equiv 7 \pmod{8}\), not 3.
  • For \(k = 1\): \(4(8l + 7) = 32l + 28 \equiv 4 \pmod{8}\), not 3.
  • For \(k \geq 2\): \(4^k(8l + 7) \equiv 0 \pmod{8}\), not 3.
Since \(8m + 3\) is never of the forbidden form, every such number is the sum of three squares.

Step 4: Ensure the squares are odd
It remains to show these three squares must be odd. Consider sums of three squares modulo 8. Perfect squares modulo 8 are 0, 1, or 4:
  • Odd squares: \(\equiv 1 \pmod{8} \)
  • Even squares: \( \equiv 0 or 4 \pmod{8} \)
The possible sums modulo 8 are 0, 1, 2, 3, 4, 5, or 6 (never 7). Specifically for \(\equiv 3 \pmod{8} \)
  • Three odd squares: \(1 + 1 + 1 = 3\)
  • Two odd, one even: \(1 + 1 + 0 = 2\) or \(1 + 1 + 4 = 6\).
  • One odd, two even: \(1 + 0 + 0 = 1, 1 + 0 + 4 = 5\), or \(1 + 4 + 4 = 9 \equiv 1\).
  • Three even: \(0 + 0 + 0 = 0, 0 + 0 + 4 = 4\), \( 0 + 4 + 4 = 8 \equiv 0\), or \(4 + 4 + 4 = 12 \equiv 4\).
The only combination yielding \(3 \pmod{8} \) is three odd squares. Therefore, since every \(8m + 3\) is the sum of three squares and \(\equiv 3 \pmod{8}\), it must be the sum of three odd squares. This completes the proof. For any even \(E = 2m\), express \(m = T_a + T_b + T_c\), then$$ \begin{align} E &= 2T_a + 2T_b + 2T_c \\ &= p_a + p_b + p_c \end{align} $$where each \(p_i \) is pronic.

This is a nice straightforward proof. I've written about pronic numbers before in posts titled:

A Range Limit of 40000: Why?

In many of my posts when I'm considering sequences, I only look at sequence members whose values do not exceed 40000. Why? The answer to this question relates to the reason that I set this blog up in the first place. It was designed primarily to post about interesting sequences associated with the numbers marking my diurnal age.

If we divide 40000 by 365.2425 (the average number of days in a year) we get slightly more than 109.5 years and there are not many people who live to that ripe old age. Here are milestones, one might say, on the road to oblivion.

Quite a few people won't see 30000 days let alone 40000 but many will and hence the realistic upper limit to the numbers that I normally investigate. The focus of my blog posts is generally the number associated with my diurnal age and the sequences that it can be connected to. For example, today I am \( \textbf{27920} \) days old.


This number found its way into a sequence that I created that involves gapful numbers with the property that not only does the number formed by the concatenation of the first and last digit divide the number but this concatenated number is also the sum of the number's digits. Thus we have:$$ \begin{align} \frac{27920}{20} &=1396 \\ \\ 2 + 7 + 9 + 2 + 0 &= 20 \end{align}$$I described this sequence in a post titled Gapgul Numbers in December of 2024. Interestingly, 27920 also has the property that it has 20 divisors. Only 19 numbers satisfy this additional criterion in the range up to 40000. The conditions to be met are:
  • the number is gapful meaning the number formed by concantenating the first and last digits divides the number without remainder
  • the sum of the number's digits equals the number formed by the concatenated first and last digits
  • the number of divisors of the number equals its sum of digits (and the concatenated number)
Here are the numbers:

1548, 1812, 1908, 10188, 10548, 11268, 12252, 12612, 12708, 13428, 14052, 14412, 15138, 18108, 21984, 26480, 27920, 29360, 39996

Here are the details:

  number        factor          concat   dividend   S0D   divisors
  1548     2^2 * 3^2 * 43         18       86         18    18
  1812     2^2 * 3 * 151          12       151        12    12
  1908     2^2 * 3^2 * 53         18       106        18    18
  10188    2^2 * 3^2 * 283        18       566        18    18
  10548    2^2 * 3^2 * 293        18       586        18    18
  11268    2^2 * 3^2 * 313        18       626        18    18
  12252    2^2 * 3 * 1021         12       1021       12    12
  12612    2^2 * 3 * 1051         12       1051       12    12
  12708    2^2 * 3^2 * 353        18       706        18    18
  13428    2^2 * 3^2 * 373        18       746        18    18
  14052    2^2 * 3 * 1171         12       1171       12    12
  14412    2^2 * 3 * 1201         12       1201       12    12
  15138    2 * 3^2 * 29^2         18       841        18    18
  18108    2^2 * 3^2 * 503        18       1006       18    18
  21984    2^5 * 3 * 229          24       916        24    24
  26480    2^4 * 5 * 331          20       1324       20    20
  27920    2^4 * 5 * 349          20       1396       20    20
  29360    2^4 * 5 * 367          20       1468       20    20
  39996    2^2 * 3^2 * 11 * 101   36       1111       36    36

6-P-6 Primes And Beyond

What I mean by a 6-P-6 prime is a prime, greater than 2,  whose two adjacent composite numbers contain exactly six prime factors with multiplicity. There are only 30 such primes in the range up to 40000 and they are (permalink):

1889, 3079, 4591, 5023, 7649, 12689, 13751, 18089, 19249, 19889, 22193, 22639, 23057, 23311, 23561, 26839, 27919, 28027, 28751, 30449, 30941, 31121, 32993, 33641, 33967, 36251, 38177, 38431, 39799, 39929

Here are the details:

  previous                prime   next

  2^5 * 59                1889    2 * 3^3 * 5 * 7
  2 * 3^4 * 19            3079    2^3 * 5 * 7 * 11
  2 * 3^3 * 5 * 17        4591    2^4 * 7 * 41
  2 * 3^4 * 31            5023    2^5 * 157
  2^5 * 239               7649    2 * 3^2 * 5^2 * 17
  2^4 * 13 * 61           12689   2 * 3^3 * 5 * 47
  2 * 5^4 * 11            13751   2^3 * 3^2 * 191
  2^3 * 7 * 17 * 19       18089   2 * 3^3 * 5 * 67
  2^4 * 3 * 401           19249   2 * 5^3 * 7 * 11
  2^4 * 11 * 113          19889   2 * 3^2 * 5 * 13 * 17
  2^4 * 19 * 73           22193   2 * 3^4 * 137
  2 * 3 * 7^3 * 11        22639   2^4 * 5 * 283
  2^4 * 11 * 131          23057   2 * 3^3 * 7 * 61
  2 * 3^2 * 5 * 7 * 37    23311   2^4 * 31 * 47
  2^3 * 5 * 19 * 31       23561   2 * 3^2 * 7 * 11 * 17
  2 * 3^3 * 7 * 71        26839   2^3 * 5 * 11 * 61
  2 * 3^3 * 11 * 47       27919   2^4 * 5 * 349
  2 * 3^4 * 173           28027   2^2 * 7^2 * 11 * 13
  2 * 5^4 * 23            28751   2^4 * 3 * 599
  2^4 * 11 * 173          30449   2 * 3 * 5^2 * 7 * 29
  2^2 * 5 * 7 * 13 * 17   30941   2 * 3^4 * 191
  2^4 * 5 * 389           31121   2 * 3^2 * 7 * 13 * 19
  2^5 * 1031              32993   2 * 3^3 * 13 * 47
  2^3 * 5 * 29^2          33641   2 * 3^3 * 7 * 89
  2 * 3^3 * 17 * 37       33967   2^4 * 11 * 193
  2 * 5^4 * 29            36251   2^2 * 3^2 * 19 * 53
  2^5 * 1193              38177   2 * 3^3 * 7 * 101
  2 * 3^2 * 5 * 7 * 61    38431   2^5 * 1201
  2 * 3^3 * 11 * 67       39799   2^3 * 5^2 * 199
  2^3 * 7 * 23 * 31       39929   2 * 3 * 5 * 11^3

The algorithm linked to above is easily modified to find 7-P-7 primes that are surrounded by two composite numbers with exactly seven prime factors with multiplicity. There are only four in the range up to 40000 are these are 10529, 15391, 32561 and 35153. The details are (permalink):

  previous            prime   next

  2^5 * 7 * 47        10529   2 * 3^4 * 5 * 13
  2 * 3^4 * 5 * 19    15391   2^5 * 13 * 37
  2^4 * 5 * 11 * 37   32561   2 * 3^5 * 67
  2^4 * 13^3          35153   2 * 3^4 * 7 * 31

There are no 8-P-8 primes in the range up to 40000 but if we extend the range to 100000 we find one (permalink):

  previous         prime   next

  2^6 * 11 * 107   75329   2 * 3^5 * 5 * 31

These number properties of certain primes are not base-dependent. Obviously as the numbers get bigger there will be instances of 9-P-9 primes and beyond.