Wednesday 31 March 2021

MathPix Snipping Tool

In my previous post I looked at how to integrate a function using the Feynman technique. The function was:$$ \int_0^1 \frac{\sin( \ln x)}{\ln x}$$It seems that blackpenredpen is fond of integrations that make use of the Feynman technique. Here is another such integral:$$\int_0^1 \frac{x-1}{\ln x} $$Here is the YouTube link. I've done the integration using pen and paper and it took me very little time as compared to how long it would have taken me using LaTeX. See Figure 1.


Figure 1

What would be good is if there was a way to convert this automatically to LaTeX, a sort of LaTeX recognition rather than text recognition. Well, it turns out that there is. I used a program called MathPix Snipping Tool and the entire page was converted instantly to LaTeX with only two minor errors. Even equal signs were aligned. This is a remarkable time saver.$$\begin{aligned}
\int_{0}^{1} \frac{x-1}{\ln x} & d x \\
\operatorname{let} I(b) &=\int_{0}^{1} \frac{x^{b}-1}{\ln x} \cdot d x \\
\frac{d}{d t} I(b) &=\frac{d}{d b} \int_{0}^{1} \frac{x^{b}-1}{\ln x} \cdot d x \\
I^{\prime}(b) &=\int_{0}^{1} \frac{\partial}{\partial b}\left(x^{b}-1\right) \cdot \frac{1}{\ln x} d x \\
&=\int_{0}^{1} \ln x \cdot x^{b} \cdot \frac{1}{\ln x} d x \\
&=\int_{0}^{1} x^{b} d x \\
&=\left[\frac{x^{b+1}}{b+1}\right]_{0}^{1} \\
&=\frac{1}{b+1} \\
I(b) &=\ln |b+1|+C \\
I(0) &=\int_{0}^{1} \frac{x^{0}-1}{\ln x} \cdot d x \\
&=0 \\
\therefore C &=0 \\
I(1) &=\ln |b+1| \\
I(1) &=\ln (2) \\
\therefore \int_0^1 \frac{x-1}{\ln x} d x&=\ln (2)
\end{aligned}$$The free version allows for 50 snips per month which is more than reasonable. Just write out the solution carefully and clearly on paper and then snip it! I'm still blown away by the ease with which this conversation is possible. 

Here is another try. Figures 2 and 3 shows the photographs. Figure 3 worked fine but Figure 2 gave me no end of trouble. It's important that the confidence level shows at least some red (which Figure 3 did and Figure 2 didn't). A good photograph is of course essential. The program makes multiple attempts which can then be trialed.


Figure 2



Figure 3
$$
\begin{array}{l}
\displaystyle \int_{0}^{1} \dfrac{\ln x}{x-1} \cdot d x \\
\text { let } u=x-1 \\
x=1+u \\
\quad d u=d x \\
\displaystyle \int_{u=-1}^{u=0} \dfrac{\ln (1+u)}{u} d u \\
\dfrac{1}{1-t}= \displaystyle \sum_{n=0}^{\infty} t^{n},|t|<1 \\
\text { let } t=-u \\
\dfrac{1}{1+u}=\displaystyle \sum_{n=0}^{\infty}(-1)^{n} \cdot u \\
\begin{array}{l}
\int \dfrac{1}{1+u} d u=\displaystyle \int \sum_{n=0}^{\infty}(-1)^{n} u^{n} d u \\
\ln (u+1)=\displaystyle C+\sum_{n=0}^{\infty}(-1)^{n} \dfrac{u^{n+1}}{n+1}
\end{array} \\
\operatorname{lit} \begin{array}{l}
u=0 \\
\ln (1+0)=\displaystyle C+\sum_{n=0}^{\infty}(-1)^{n} \cdot 0^{n+1} \\
\ln (1+u)=\displaystyle \sum_{n=0}^{\infty} \dfrac{(-1)^{n}}{n+1} \cdot u^{n+1} \\
\dfrac{\ln (1+u)}{u}=\displaystyle \sum_{n=0}^{\infty} \dfrac{(-1)^{n}}{n+1} \cdot u^{n}
\end{array}
\end{array}
$$
$$\begin{aligned}
\int_{0}^{1} \frac{\ln x}{x-1} d x &=\int_{n=-1}^{0} \frac{\ln (1+u)}{u} d u \\
&=\int_{u=-1}^{0} \sum_{n=0}^{\infty} \frac{(-1)^{n}}{n+1} \cdot u^{n} d_{n} \\
&=\left.\sum_{n=0}^{\infty} \frac{(-1)^{n}}{(n+1)^{2}} u^{n+1}\right|_{n=-1} ^{n=0} \\
&=\sum_{n=0}^{\infty} \frac{(-1)^{n}}{(n+1)^{2}} \cdot 0^{n+1}-\sum_{n=0}^{n} \frac{(-1)^{n}(-1)^{n+1}}{(n+1)^{2}} \\
&=-\sum_{n=0}^{\infty} \frac{(-1)^{2 n} \cdot(-1)}{(n+1)^{2}} \\
&=\sum_{n=0}^{\infty} \frac{1}{(n+1)^{2}} \\
&=\frac{1}{1^{2}}+\frac{1}{2^{2}}+\frac{1}{3^{2}}+\frac{1}{4^{2}}+\ldots \\
&=\frac{\pi^{2}}{6}
\end{aligned}$$Of course, mathematically printed material converts with only minor glitches. Figure 4 shows page 72 of "Catalan Numbers with Applications" by Thomas Koshy.


Figure 4

Cesáro First Order Mean

The next example, another application of Wallis's formula, was proposed in 1957 by J. Barlaz of Rutgers University, New Brunswick, New Jersey. The solution is based on the one given the following year by $\mathrm{R}$. Breusch of Amherst College, Massachusetts.

Example 3.2 Evaluate the Cesáro first order mean for the series $$\sum_{n=2}^{\infty}(-1)^{n} \log n$$Solution Let \( \displaystyle S_{m}=\sum_{n=2}^{m}(-1)^{n} \log n\). Then, by Wallis's formula,$$
\begin{array}{c}
S_{2 n}=\dfrac{2 \cdot 4 \cdots(2 n)}{3 \cdot 5 \cdots(2 n-1)} \quad \text { and } \quad S_{2 n+1}=\dfrac{2 \cdot 4 \cdots(2 n)}{3 \cdot 5 \cdots(2 n+1)} \\
\begin{align}
S_{2 n}+S_{2 n+1}&=\log \frac{2 \cdot 2}{1 \cdot 3} \cdot \dfrac{4 \cdot 4}{3 \cdot 5} \cdots \dfrac{(2 n) \cdot(2 n)}{(2 n-1) \cdot(2 n+1)} \\
&=\log (\pi / 2)+O(1 / n) \\
\displaystyle \sum_{n=2}^{m} S_{n}&=\dfrac{m}{2} \log (\pi / 2)+O(\log m)
\end{align}
\end{array}
$$Thus the Cesáro first order mean is given by$$
\lim _{m \rightarrow \infty} \dfrac{1}{m} \sum_{n=2}^{m} S_{n}=\dfrac{1}{2} \log (\pi / 2)
$$

Tuesday 30 March 2021

Analysis of an Interesting Graph

In my last post I evaluated the integral of the function:$$y= \frac{\sin(\ln x)}{\ln x}$$ between 0 and 1 and arrived at a value of \( \frac{\pi}{4} \) using Feyman's technique. In this post, I want to look at the function more closely in terms of its turning points and intercepts on the \(x\) axis. Figure 1 shows the behaviour of the graph in the region between 0 and 1.



Figure 1: created using GeoGebra

Clearly there is a small negative area that will reduce the largely positive area slightly but the figure of \( \frac{\pi}{4} \approx \) 0.785398163397448 looks pretty right. Clearly, the graph cuts the \(x\) axis around 0.4 but what about further out along the \(x\) axis? Figure 2 shows the graph of the function in the range from 0 to 100:


Figure 2: created using Wolfram Alpha

Figure 3 shows a slightly different view. 


Figure 3: created using Wolfram Alpha

Let's look at the graph in the range from 0 to 1000. Figure 4 shows this:

Figure 4: created using Wolfram Alpha

To see what's going on with these intercepts on the \(x\) axis we just need to set the function equal to zero. Let's do this and solve the resulting equation:$$
\begin{align} \frac{\sin(\ln x)}{\ln x}&=0\\
\implies \sin(\ln x)&=0 \text{ provided that } \ln x \neq 0\\
\implies \ln x &=n\pi \text{ where }n \in \mathbb{Z} \text{ and } n \neq 0\\
\therefore x&=e^{\ \pi \ n} \text{ with } n \neq 0
\end{align}$$Thus we begin to see what's going on:
  • The intercept in Figure 1 corresponds to \(n=-1\) and \(e^{-\pi} \approx 0.04 \)
  • The intercept in Figure 2 corresponds to \(n=1\) and \(e^{\pi} \approx 23.14 \)
  • The intercept in Figure 4 corresponds to \(n=2\) and \(e^{2\pi} \approx 535.49 \)
Clearly as \(n\) grows larger, the values of \(e^{\ \pi \ n}\) become very large and the intercepts more and more spread out along the number line. Similarly as -\(n\) grows larger negatively, the values of \(e^{\ -\pi \ n}\) become very small and the intercepts closer and closer together.

What about the turning points of the graph? To explore this we need to find the first derivative of the function. We find:$$
\begin{align}
\frac{d}{dx} \left (\frac{\sin(\ln x)}{\ln x} \right )&=\frac{\ln x \cos(\ln x)-\sin(\ln x)}{x \ln^2 x}\\
\implies \ln x \cos(\ln x)-\sin(\ln x)&=0 \text{ provided } x \ln^2 x \neq 0
\end{align}$$A partial solution to this is offered by Wolfram Alpha but the computation times out so only three solutions are shown. See Figure 5:


Figure 5: from Wolfram Alpha

From these results we can see the local minimum of \(x \approx 0.01\) in Figure 1 and the local maximum of x=1 in Figure 3. Some further results can be obtained from Wolfram Alpha simply by asking for turning points. These are shown in Figure 6.


Figure 6: from Wolfram Alpha

These results are most interesting because we can see a maximum value of around 0.049 when \(x=0\) but a minimum value of around -0.058 when \(x=0\)! Clearly, the function should be undefined at \(x=0\) even though a limit of 0 seems to exist. The issue of the limit is an interesting one which I may take up in a subsequent post but for the time being that's probably enough for the graph.

More Feynman Integration

On December 20th 2020, I created a post titled Feynman Integration in which I used Feynman's technique to show that: $$\int_\infty^\infty \frac{\cos x}{x^2+1} \mathrm{d}x=\frac{\pi}{\mathrm{e}}$$Lately my daily number analysis has not generated any material for a post but I have been practising my LaTeX skills and I thought that this blackpenredpen video that involved the use of Feynman's technique provided a good opportunity in this regard. Here is the video:


In this post, I'll be showing that:$$\int_0^1 \frac{\sin(\ln x)}{\ln x} \mathrm{d}x=\frac{\pi}{4}$$So let's get started. Firstly, we need to remember that:$$\begin{align}
\sin z &= \frac{e^{iz}-e^{-iz}}{2i}\\
\therefore \sin( \ln x)&=\frac{e^{i \ln x}-e^{-i \ln x}}{2 i}\\
&=\frac{e^{(\ln x)^{i}}-e^{(\ln x )^{-i}}}{2i}\\
&=\frac{x^i-x^{-i}}{2i}
\end{align}$$Thus our original integral changes:$$\begin{align} \int_0^1 \frac{\sin(\ln x)}{\ln x} \mathrm{d}x&=\int_0^1 \frac{x^i-x^{-i}}{2i \ln x} \mathrm{d}x\\
\text{ let }I(b) &=\int_0^1 \frac{x^{bi}-x^{-i}}{2i \ln x} \mathrm{d}x \text{ where }b \text{ is a parameter}\\
\frac{\mathrm{d}}{\mathrm{d}b}I(b) &=\frac{\mathrm{d}}{\mathrm{d}b}\int_0^1 \frac{x^{bi}-x^{-i}}{2i \ln x} \mathrm{d}x\\
I'(b)&=\int_0^1 \frac{\partial{}}{\partial{b}} \left (\frac{x^{bi}-x^{-i}}{2i \ln x} \right ) \mathrm{d}x \\
&=\int_0^1 \frac{\ln x \cdot x^{bi} \cdot i}{2i \ln x}\\
&=\frac{1}{2} \int_0^1 x^{bi} \mathrm{d} x\\
&=\frac{1}{2}\left[\frac{x^{bi+1}}{bi+1}\right]_{x=0}^{x=1}\\
&=\frac{1}{2(bi+1)}\\
\therefore I(b)&=\frac{\ln(bi+1)}{2i}+C\\
\text{but } I(-1)&=\int_0^1 \frac{x^{-1}-x^{-1}}{2i \ln x} \mathrm{d} x \text{ when }b=-1\\
&=0\\
\therefore C&=-\frac{\ln(1-i)}{2i}\\
\text{and } I(b)&=\frac{\ln(bi+1)}{2i}-\frac{\ln(1-i)}{2i}\\
I(1)&=\frac{\ln(1+i)}{2i}-\frac{\ln(1-i)}{2i}\\
&=\frac{1}{2i} \left (\ln(1+i)-\ln(1-i) \right )\\
&=\frac{\ln \left (\dfrac{1+i}{1-i} \right )}{2i}\\
&=\frac{1}{2i} \cdot \ln i\\
&=\frac{1}{2i} \cdot \frac{\pi}{2} \cdot i\\
&=\frac{\pi}{4}\\
\text{thus }\int_0^1 \frac{\sin(\ln x)}{\ln x} \mathrm{d}x&=\frac{\pi}{4}
\end{align}$$
Even though complex numbers were used in the solution, the final result for our real integral yielded a real solution. The typesetting for this post took quite some time but it provided valuable practice. So what does the graph of the function \( \dfrac{\sin(\ln x)}{\ln x}\) look like? This is what my next post will examine.

Tuesday 23 March 2021

189

It's not often that I have a very explicit dream about numbers or a number. Last night I was aware that I was in a long queue with unseen people and a voice announced that we should take note of the number that was displayed on the back of the person in front of us. The number was displayed in large black print and in my case the number was 189. I had been thinking of slipping away and leaving the queue but then I realised that the person behind me would have noted the number displayed on my back and that I was thus a marked man.

That was the extent of the dream, although there is a vague memory of another number which I think was 1094. However, this recollection is more mental and quite different to my close-up and very visual encounter with 189. On waking, I was left wondering what was the significance of this number. Firstly, it should be noted that 189 wasn't MY number. It was the number on the back of the person in front of me in the queue. Given that I was behind this person in a winding line of other people, it might be supposed that my number was 190. However, this is sheer conjecture. Let's return to 189 and explore the properties of this number because this is the number that I saw so clearly and closely in front of me.

Given that I buy tickets in the Australian lottery from time to time, I must confess that my first thought was in connection to gambling rather than the number's possible mystic significance. It turns out that mathematically 189 is a lucky number, lucky in the sense that it survives a savage culling process that eliminates every second, then every third, then even fourth etc. number. Up to 189, the lucky numbers are:
[1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 49, 51, 63, 67, 69, 73, 75, 79, 87, 93, 99, 105, 111, 115, 127, 129, 133, 135, 141, 151, 159, 163, 169, 171, 189]

The lottery numbers however, range from 1 to 45 and so how to extract numbers in that range from 189. One obvious way to consider the divisors of the numbers. These are:

[1, 3, 7, 9, 21, 27, 63, 189] 

Of these, it can be seen that 1, 3, 7, 9, 21 and 27 qualify. Normally six or seven numbers must be chosen and so, using divisors, we have six numbers. How might we get seven? We could use a modular approach whereby, once 46 is reached, counting starts again from zero. However, zero is not included in the lottery numbers so it is better to simply subtract 45 from numbers larger than 45. In this way, 46 becomes 1 and 63 becomes 18. For 189, more steps are needed:

189 - 45 = 144 | 144 - 45 = 99 | 99 - 45 = 54 | 54 - 45 = 9

Using this approach, the divisors become [1, 3, 7, 9, 18, 21, 27] with 189 yielding 9 which is already a divisor. Thus we get seven numbers and seven sets of six numbers (with the original six number set marked with an asterisk):

[ 1, 3, 7, 9, 18, 21]

[ 1, 3, 7, 9, 18, 27]

 [1, 3, 7, 9, 21, 27]*

[1, 3, 7, 18, 21, 27]

[1, 3, 9, 18, 21, 27]

[1, 7, 9, 18, 21, 27]

[3, 7, 9, 18, 21, 27]

Perhaps the "best" choice amongst this group is [3, 7, 9, 18, 21, 27] because it doesn't include 1 which is a divisor of every number, not just 189.


Another quite different approach is to consider other special properties of 189, like for instance its membership of OEIS A000930: 


 A000930

Narayana's cows sequence: a(0) = a(1) = a(2) = 1                      
thereafter a(n) = a(n-1) + a(n-3).

The members of this sequence, up to and including 189, are:

1, 1, 1, 2, 3, 4, 6, 9, 13, 19, 28, 41, 60, 88, 129, 189

Let's count backwards from 189 until we reach six and then seven numbers that are eligible lottery numbers. Doing this get:

4, 6, 9, 13, 19, 28, 41

Again we can use these seven numbers to generate seven sets of six numbers:

[4, 6, 9, 13, 19, 28]

[4, 6, 9, 13, 19, 41]

[4, 6, 9, 13, 28, 41]

[4, 6, 9, 19, 28, 41]

[4, 6, 13, 19, 28, 41]

[4, 9, 13, 19, 28, 41]

[6, 9, 13, 19, 28, 41]


While perhaps the seed number 1 should be excluded, there's no reason not to include the 2 and 3 in Narayana's cows sequence. This would yield nine eligible numbers and thus many six and seven sets of numbers. It's simply a matter of choice.

Another important property of 189 is that it can be expressed as a sum of two cubes:$$189=64+125=4^3+5^3$$Numbers that are the sum of two positive cubes form OEIS A003325. How can this be translated into lottery numbers? I'm sure that there are ways but maybe it's time to let go of the lottery angle and just look at the various properties of 189. 

The partition [64, 125] is doubly significant for 189 because 64 can be written as a square (\(8^2\) as well as a cube and so it qualifies for admission to OEIS A055394: numbers that are the sum of a positive square and a positive cube. These numbers are relatively frequent and run:
2, 5, 9, 10, 12, 17, 24, 26, 28, 31, 33, 36, 37, 43, 44, 50, 52, 57, 63, 65, 68, 72, 73, 76, 80, 82, 89, 91, 100, 101, 108, 113, 122, 126, 127, 128, 129, 134, 141, 145, 148, 150, 152, 161, 164, 170, 171, 174, 177, 185, 189, ...
189 is also a centered cube number because it is of the form:$$n^3+(n+1)^3$$Here \(n=4\) and these numbers form OEIS A005898.

Another property is that it's an Ulam number. It is the smallest possible, unique sum of two smaller Ulam numbers, 87 and 102. Thus the partition [87, 102] is also significant for 189. The Ulam numbers form OEIS A002858

189 is an heptagonal (or 7-gonal) number. These numbers form OEIS A085787  and are of the form:$$ \frac{n \, (5n-3)}{2}$$In the case of 189, we have \(n=9\) and the OEIS sequence runs:

0, 1, 7, 18, 34, 55, 81, 112, 148, 189, ...

189 is also an enneagonal (9-gonal) number. These numbers from OEIS A118277 and are of the form:$$ \frac{n \, (7n-5)}{2}$$The sequence runs:

0, 1, 6, 9, 19, 24, 39, 46, 66, 75, 100, 111, 141, 154, 189, ...

189 is also associated with the prime generating polynomials: \(n^2 \pm n+1\) because \(189^2 + 189+1 = 35911\) and \(189^2 - 189+1=35533\) are both prime and this qualifies the number for admission to OEIS A002384 and OEIS A055494.

At the time of writing, there are 6984 entries in the OEIS for 189 and so I'll have to make a stop.

Sunday 14 March 2021

Squircles and Sphubes

I came across a reference to a shape called a squircle recently, a portmanteau word formed from square and circle. I thought I'd investigate its mathematical properties. The squircle is a special case of the superellipse defined as:$$
\bigg |\frac{x-a}{r_a}\bigg |^n+\bigg |\frac{y-b}{r_b}\bigg |^n=1$$where \(r_a\) and \(r_b\) are the semi-major and semi-minor axes and \(a\) and \(b\) are the \(x\) and \(y\) coordinates of the centre of the ellipse. The squircle is then defined as the superellipse with \(r_a=r_b=r\) and \(n=4\). So we have:$$(x-a)^4+(y-b)^4=r^2$$where \(r\) is the minor radius of the squircle. In its simplest form, when \(a=b=0\) and \(r=1\), we have:$$x^4+y^4=1$$Figure 1 shows this:


Figure 1: created using GeoGebra

The area inside the circle can be expressed in terms of the gamma function \( \Gamma(x) \) as follows:$$
\text{Area }=4r^2 \frac{\big ( \Gamma(1+\frac{1}{4}) \big )^2}{\Gamma(1+\frac{2}{4})}=8r^2 \frac{ \big ( \Gamma(\frac{5}{4}) \big )^2}{\sqrt{ \pi}}=S \sqrt{2} r^2 \approx 3.708 r^2$$where \(r\) is the minor radius of the squircle and \(S\) is the lemniscate constant. I've no idea as to how that equation comes about and just summarising what's in Wikipedia.

Another squircle is of the form:$$x^2+y^2-\frac{s^2}{r^2}x^2y^2=r^2$$ where \(r\) is the minor radius of the circle and \(s\) is the squareness parameter. If \(s=0\), we have a circle and if \(s=1\), we have a square. Figure 2 shows the case where \(r=1\) and \(s=0.9\). This form of the squircle can be referred to as the FG-squircle after Fernández–Guasti, after one of its authors.


Figure 2: GeoGebra link

Squircles have also been used to construct dinner plates. A squircular plate has a larger area (and can thus hold more food) than a circular one with the same radius, but still occupies the same amount of space in a rectangular or square cupboard. See Figure 3:


Figure 3: source

There is a site that let's you create your own squircles. See Figure 4.



Figure 4: https://squircley.app/

The three dimensional equivalent of a squircle could be called a sphube as this article suggests: Three Dimensional Counterpart of the FG-squircle. The equation of such a 3-D shape is given by:$$
x^2+y^2+z^2-\frac{s^2}{r^2}x^2y^2--\frac{s^2}{r^2}y^2z^2-\frac{s^2}{r^2}x^2z^2+\frac{s^4}{r^4}x^2y^2z^2=r^2$$Just like the FG-squircle, this shape has two parameters: squareness \(s\) and radius \(r\). When \(s\) = 0, the shape is a sphere with radius \(r\). When \(s =1\), the shape is a cube with side length \(2r\). In between, it is a three dimensional shape that resembles the sphere and the cube. The shape is shown in Figure 5 at varying values of squareness.


Figure 5: source

The article mentioned previously,  Three Dimensional Counterpart of the FG-squircle, treats other 3-D shapes among them being the: 
  • squircular ellipsoid (sqellipsoid)
  • squircular cylinder (sqylinder)
  • squircular cone (sqone)
  • sphylinder

Sunday 7 March 2021

Neglected Numbers

Sometimes it's easy to give up on numbers. Take 26271 for example. This number represents my diurnal age today and when I searched in the OEIS nothing of interest showed up. Even a search using OEIS + 26271, which often throws up OEIS b-files containing the number, didn't reveal anything interesting. 

Figure 1: link

In such situations I fall back on the Sequence Database: a database with 2402879 machine generated integer and decimal sequences. I discovered this site in June of 2020. Unfortunately, this didn't turn up any sequences of interest either but then I remembered another site that lists sequences (see Figure 1). 

It was here that I found something of substance. See Figure 2.


Figure 2

26271 belongs to a sequence of numbers \(n\) with the property that \(n\) is 5-almost prime and \(n+1 \) is 6-almost prime. In the case of 26271, it factors to \(3^3 \times 7 \times 139 \) and 26272 factors to \(2^5 \times 821\). The example of 728, the first member of the sequence, is given in Figure 1.

It's easy enough to generate this sequence in SageMath, using the algorithm shown in Figure 3:


Figure 3: permalink

This algorithm can be easily modified to search for other patterns involving \(k\)-almost primes where \(k \geq 2\). For example, what numbers \(n\) are there, up to 26271, with the property that \(n\) is 4-almost prime and \(n+1 \) is 5-almost prime? These numbers turn out to be quite numerous and I won't list them all here but notice how 26270 makes an appearance:

495, 975, 1071, 1287, 1484,  ... , 26075, 26103, 26195, 26215, 26270

From this we can see that 26271 is the middle term in a triplet of numbers with the property that: 
  • \(26270 = 2 \times 5 \times 37 \times 71\) and is 4-almost prime
  • \(26271 = 3^3 \times 7 \times 139 \) and is 5-almost prime
  • \(26272 = 2^5 \times 821\) and is 6-almost prime
This condition could be a good candidate for admission to the OEIS. It could be framed as follows:
Numbers \(n\) such that \(n-1\) is 4-almost prime, \(n\) is 5-almost prime and \(n+1\) is 6-almost prime.
Up to 100,000 the members of this sequence are:
11151, 13455, 23375, 26271, 31311, 33776, 36125, 40375, 45495, 46375, 48411, 49049, 49167, 61335, 63125, 74151, 77895, 78111, 78351, 80271, 82575, 83511, 84591, 86031, 87375, 88749, 90207

I checked and this sequence is not currently in the OEIS so I'll put it forward as a candidate and report back here when it's approved.

Reporting back, I'm happy to report that the sequence was approved, although one of the arbiters took exception to my use of the term \(n\)-almost prime and suggested that it be replaced by composite with \(n\) prime factors. I followed this suggestion (always a good idea to keep the arbiters on side) and the result is OEIS A342246:


 A342246

Numbers \(n\) such that \(n-1\), \(n\) and \(n+1\) are all composite with four, five and six (not necessarily distinct) prime factors respectively

Before I discovered the 5-almost prime and 6-almost prime link on the Italian site, I also made a discovery of my own. 26271 is a member of a sequence of numbers such that the sum of its digits is equal to the sum of the digits of its totient. Here the digits of 26271 add to 18 and the digits of its totient 14904 also add to 18. Up to 26271, about 7.61% of numbers have this property. The members of this sequence, up to 1000, are as follows:

1, 21, 27, 34, 54, 63, 81, 106, 108, 117, 126, 129, 135, 136, 142, 147, 156, 162, 171, 178, 195, 205, 212, 214, 216, 234, 237, 243, 252, 270, 272, 291, 315, 324, 333, 342, 351, 356, 358, 394, 402, 405, 424, 432, 441, 459, 493, 502, 504, 513, 538, 540, 544, 565, 585, 624, 630, 663, 702, 712, 714, 716, 718, 723, 729, 745, 804, 810, 831, 834, 835, 840, 864, 873, 918, 932, 934, 936, 943, 981

This discovery also prompted me to investigate the sum of the digits of the sum of the divisors. The percentage of numbers whose sum of digits equals the sum of the digits of the sum of its divisors is 4.59%. The members of this sequence, up to 1000, are as follows:

1, 15, 24, 64, 69, 78, 90, 114, 133, 147, 153, 186, 198, 258, 270, 276, 288, 306, 339, 360, 366, 393, 429, 474, 492, 495, 507, 522, 582, 588, 609, 618, 627, 639, 708, 717, 738, 762, 763, 801, 817, 834, 846, 871, 906, 933, 960, 978, 990

The percentage of numbers whose sum of digits equals both the sum of the digits of the sum of its divisors AND the sum of the digits of its totient is 0.727%. The members of this sequence, up to 10000, are as follows:

1, 147, 270, 834, 1158, 1374, 1377, 2028, 2214, 2436, 2454, 2538, 2592, 2646, 2754, 2862, 2907, 3339, 3726, 4293, 4320, 4371, 4614, 5049, 5262, 5319, 5472, 5508, 5607, 5670, 5751, 5802, 6234, 6291, 6426, 6570, 6972, 7155, 7209, 7434, 7560, 7605, 7614, 8190, 8934, 9126, 9270, 9315, 9333, 9342, 9720, 9744, 9810

This last sequence might be an interesting one for admission to the OEIS (as it's not currently in there) but I'll wait until my current submission is approved. This is again easy to generate in SageMath as Figure 4 shows:


Figure 4: permalink

In conclusion, it can be said that 26271 is an Ulam number, being the sum of two previous Ulam numbers, namely 47 and 26224. It is also a happy number since repeated sums of squares of digits lead to 1. However, as we've seen, it also has other interesting properties that a little research uncovered.

Wednesday 3 March 2021

Celebrating Gaps Between Twin Primes


Figure 1

It was back in June of 2017 that I celebrated the end of a drought of twin prime numbers (see post Gaps Between Twin Primes). I'll reproduce here, in Figure 1, the table that appears in that post. On June 22nd, I had just turned 24917 days old and 24917 is a prime that, together with 24919, forms a pair of twin primes. The previous pair is 24419 and 24421. Between the larger of the first pair (24421) and the smaller of the second pair (24917), there is a record gap of 496.

In this gap, there are 40 singleton primes or primes that are not part of a twin prime pair. This is also a record and the first of these singleton primes is 24439 that is a member of OEIS A065044, prime numbers that start a run of exactly \(n\) consecutive primes, none of which are twin primes. This remarkable gap is not surpassed until 62303, a prime that begins a run of 52 singleton primes. As can be seen in Figure 1, these 52 primes lie between the twin prime pairs of (62297, 62299) and (62927, 62929).

Today I turned 26267 days old and this number is also a member of OEIS A065044 marking a run of 36 singleton primes, the last of which is 26669. It needs to be noted that this is not a record run because the sequence registers the first prime in a run of exactly \(n\) primes. Likewise, the gap between the twin primes before and after this run of singleton primes is considerable (418) but far from the record of 496. The twin primes in question are (26681, 26683) and (26261, 26263). Figure 2 shows the situation:


Figure 2: there is a gap of 418 between the twin prime pairs

Here are the members of OEIS A065044 up to \(n\)=40:

2, 47, 113, 79, 2273, 1097, 467, 1327, 1163, 353, 5749, 3011, 5297, 10151, 1493, 9467, 887, 673, 13033, 9049, 15373, 8641, 28759, 83737, 13411, 18553, 14633, 44777, 54037, 60271, 59693, 142169, 77719, 61583, 178939, 26267, 122887, 293269, 89083, 24439

The story is not over yet however, because on the day following this post (when I turned 26268 days old) I discovered that 26268 is a member of OEIS A113274:


 A113274

Record gaps between twin primes.     


The members of this sequence up to 26268 are as follows:
2, 6, 12, 18, 30, 36, 72, 150, 168, 210, 282, 372, 498, 630, 924, 930, 1008, 1452, 1512, 1530, 1722, 1902, 2190, 2256, 2832, 2868, 3012, 3102, 3180, 3480, 3804, 4770, 5292, 6030, 6282, 6474, 6552, 6648, 7050, 7980, 8040, 8994, 9312, 9318, 10200, 10338, 10668, 10710, 11388, 11982, 12138, 12288, 12630, 13050, 14262, 14436, 14952, 15396, 15720, 16362, 16422, 16590, 16896, 17082, 18384, 19746, 19992, 20532, 21930, 22548, 23358, 23382, 25230, 26268, ...

However, the gap is measured from the smaller of the first twin prime pair to the larger of the second twin prime pair. For example, the gap between (17, 19) and (29, 31) is taken to be 12. Figure 1 shows the gap as being 10 because the gap is measured from the larger of first twin prime pair to the smaller of the second twin prime pair (29 - 19 = 10). Figure 1 is based on OEIS A036063 whose members differ from OEIS A113274 by 2.


 A036063



Increasing gaps among twin primes: size.     

All the gaps shown in Figure 1 appear in this sequence but the following shows the list of its members extended to 26266:

0, 4, 10, 16, 28, 34, 70, 148, 166, 208, 280, 370, 496, 628, 922, 928, 1006, 1450, 1510, 1528, 1720, 1900, 2188, 2254, 2830, 2866, 3010, 3100, 3178, 3478, 3802, 4768, 5290, 6028, 6280, 6472, 6550, 6646, 7048, 7978, 8038, 8992, 9310, 9316, 10198, 10336, 10666, 10708, 11386, 11980, 12136, 12286, 12628, 13048, 14260, 14434, 14950, 15394, 15718, 16360, 16420, 16588, 16894, 17080, 18382, 19744, 19990, 20530, 21928, 22546, 23356, 23380, 25228, 26266, ...

So the triplet 26266, 26267 and 26268 all make an appearance in this post. The first and last numbers are connected by the fact that the sequences to which they belong are both measuring gaps but in two different ways. The middle number is not connected with its neighbours and is measuring something quite different (the beginning of a record run of singleton primes). It's just coincidence that it falls between its two gap measuring neighbours as it does.