Friday 30 April 2021

Odd Deficient Numbers

I've written about deficient numbers in an eponymous post on January 28th 2018 and in which I mentioned, for the first time in my postings, the ratio between the sum of the divisors of a number and the number itself viz. \( \displaystyle \frac{\sigma_1(n)}{n} \).

In that post, I didn't refer to the ratio by its name of abundancy but in later posts I explored the concept of abundancy in more detail. Here are links to posts in which it was discussed:

The last two posts, as can be noted, are relatively recent. Today, in turning 26325 days old, I encountered a reference to abundancy once again. Specifically in the context of OEIS A188597:


 A188597

Odd deficient numbers whose abundancy is closer to 2 than any smaller odd deficient number.


My diurnal age is a member of this sequence which runs:
1, 3, 9, 15, 45, 105, 315, 1155, 26325, 33705, 449295, 1805475, 10240425, 13800465, 16029405, 16286445, 21003885, 32062485, 132701205, 594397485, 815634435, 29169504045, 40833636525, 295612416135, 636988686495, 660733931655, 724387847085, 740099543085, 1707894294975, 4439852974095, 7454198513685

 Figure 1 shows the progression:


Figure 1

Not surprisingly, all these numbers are highly composite, despite all being deficient. This can be seen in Figure 2 where a table of factorisation and number of divisors is presented.


Figure 2

There are a number of related sequences, one of them is OEIS A171929


 A171929

Odd numbers whose abundancy is closer to 2 than any smaller odd number.


Here the numbers need only to odd and can be abundant or deficient. Figure 3 shows the abundancy and its absolute difference from 2.


Figure 3

Another related sequence is OEIS A188263:


 A188263



Odd abundant numbers whose abundancy is closer to 2 than any smaller odd abundant number.

 
In this sequence, all the numbers are abundant and thus their abundancy is greater than 2. Figure 4 shows a table of the initial numbers and their abundancies.


Figure 4

It's interesting to consider the idea that the limit of the abundancy of these sorts of odd abundant and odd deficient numbers is actually 2 as their abundancy can be as close to 2 as desired. 

Tuesday 27 April 2021

Perimeters of Pythagorean Right-Angled Triangles

Right-angled triangles with whole number sides have fascinated mathematicians and number enthusiasts since well before 300 BC when Pythagoras wrote about his famous "theorem". The oldest mathematical document in the world, a little slab of clay that would fit in your hand, can be seen a list of such triangles. So what is so fascinating about them? This page starts from scratch and has lots of facts and figures with several online calculators to help with your own investigations. Source.

This site from which this quote was taken is a great resource and I was prompted to visit it after investigating the number 26322 that constituted my diurnal age today (Tuesday, April 27th 2021). One of the properties of this number is that its a member of OEIS A098714:


 A098714

Only one Pythagorean triangle of this perimeter exists. 
               

The members of this sequence are relatively numerous. 26322 is the 2888th member of this sequence so they comprise 10.97% of all numbers up to 26322, a slightly higher frequency than the primes and lucky numbers. However, if the restriction that only one triangle can exist is removed, then 26322 is the 5720th member of OEIS A010814 and so 21.73% of all numbers up to this point are perimeters of one or more Pythagorean triangles.

 
A010814

Perimeters of integer-sided right triangles.                    


Let's return to the Pythagorean triangle of perimeter 26322 (units) for a moment and determine what the lengths of the sides of the triangle are that make up this perimeter. Figure 1 shows the SageMath code that I developed for this purpose with permalink attached.


Figure 1: permalink

The output from this code reveals that the sides are 3424, 11193 and 11705 (units). Figure 2 shows a not necessarily to scale representation of the triangle.

Figure 2

Now let's return to the site mentioned at the start of this post and see what interesting information can be extracted about perimeters of Pythagorean right-angled triangles. Figure 3 shows a table listing all Pythagorean Triples with sides up to 100 arranged in order of hypotenuse (longest side).


Figure 3

Primitive Pythagorean triads are those whose greatest common divisor (gcd) is 1 e.g. 3, 4, 5. The triad 6, 8, 10 on the other hand is not primitive because the gcd is 2. The site lists some other interesting sequences from the OEIS that follow on from those mentioned earlier.

 
 A099831


Perimeters of Pythagorean triangles that can be constructed in exactly two different ways.


The members of this sequence are far less frequent than those for triangles that can be constructed in only one way. Initial members of OEIS A099831 are:
60, 84, 90, 132, 144, 210, 264, 270, 288, 300, 312, 330, 390, 408, 432, 440, 450, 456, 462, 468, 510, 520, 546, 552, 570, 576, 588, 612, 616, 680, 684, 690, 700, 728, 760, 770, 800, 810, 816, 828, 870, 910, 912, 918, 920, 952, 1044, 1064, 1100, 1104, 1116, ...

 A099832



Perimeters of Pythagorean triangles that can be constructed in exactly three different ways.


The initial members of OEIS A099832 are:
120, 168, 180, 252, 280, 336, 396, 528, 540, 560, 600, 624, 792, 864, 880, 936, 1040, 1050, 1056, 1120, 1176, 1224, 1232, 1248, 1350, 1368, 1380, 1404, 1456, 1620, 1632, 1650, 1656, 1710, 1728, 1740, 1760, 1764, 1824, 1836, 1860, 1960, 2002, 2052, 2080, ...

 A099833

Perimeters of Pythagorean triangles that can be constructed in exactly four different ways.


The initial members of OEIS A099833 are:
240, 360, 480, 504, 630, 672, 756, 780, 900, 960, 990, 1020, 1092, 1140, 1170, 1188, 1344, 1386, 1400, 1428, 1530, 1540, 1596, 1638, 1820, 1920, 1932, 1950, 2070, 2112, 2240, 2244, 2268, 2376, 2380, 2448, 2496, 2508, 2610, 2652, 2660, 2688, 2736, 2800, ...

 A156687



Perimeters of Pythagorean triangles that can be constructed in exactly five different ways.

 The initial members of OEIS A156687 are:

420, 660, 924, 1008, 1080, 1200, 1512, 1584, 1716, 1800, 1872, 1890, 2700, 3150, 3168, 3240, 3480, 3528, 3570, 3720, 3744, 4410, 4440, 4536, 4590, 4704, 4872, 4896, 4950, 5208, 5292, 5472, 5600, 5670, 6000, 6090, 6210, 6216, 6624, 6630, 6660, 6888, ...

With all members of these sequences, the SageMath algorithm can be applied to determine what the sides of the triangles are. For example, the first member of OEIS A156687, 420, yields:

  • 105, 140, 175
  • 70, 168, 182
  • 120, 126, 174
  • 60, 175, 185
  • 28, 195, 197
As can be seen, of the above five triads, only one is primitive (28, 195, 197). It is interesting to consider only primitive triads and in doing so, some interesting results emerge:
  • The first primitive Pythagorean triangles with the same perimeter are 195, 748, 773 and 364, 627, 725 with a perimeter of 1716. The next such perimeters are 2652, 3876, 3960, ... and these perimeters constitute OEIS A024408.

 A024408

Perimeters of more than one primitive Pythagorean triangle.               


We have to go up to a perimeter of 14280 before we find three primitive triads with the same perimeter: 119, 7080, 7081 and 168, 7055, 7057 and 3255, 5032, 5993. It should be noted that there are 19 distinct triads with a perimeter of 14280 but only the three mentioned are primitive. Similarly the next member of the sequence 72930 has 16 triads but only three that are primitive (2992, 34905, 35033 and 7905, 32032, 32993 and 18480, 24089, 30361). The initial members of OEIS A024408 are:
1716, 2652, 3876, 3960, 4290, 5244, 5700, 5720, 6900, 6930, 8004, 8700, 9300, 9690, 10010, 10788, 11088, 12180, 12876, 12920, 13020, 13764, 14280, 15252, 15470, 15540, 15960, 16380, 17220, 17480, 18018, 18060, 18088, 18204, 19092, 19320, 20592, 20868, ...

It can be noted that any right-angled triangle whose side lengths are a Pythagorean triple is a Heronian triangle, as the side lengths of such a triangle are integers, and its area is also an integer, being half of the product of the two shorter sides of the triangle, at least one of which must be even. See earlier post on Heronian triangles. 

Monday 26 April 2021

Sum and Differences of Odd and Even Powers

Sometimes you need to go back to basics. I found that I was getting confused about the factorisation of general expressions like \(x^n+y^n \). 

SUM OF ODD AND EVEN POWERS

It turns out that if \(n\) is odd, then factorisation is possible according to the rule:$$a^{2n+1}+b^{2n+1}=(a+b)(a^{2n}-a^{2n-1}b+a^{2n-2}b^2- \dots - ab^{2n_1}+b^{2n} \text{ where }n \geq 1$$As an example, consider \(x^7+b^7 \) where$${x^7+b^7=\left(x^{6} - x^{5} y + x^{4} y^{2} - x^{3} y^{3} + x^{2} y^{4} - x y^{5} + y^{6}\right)} {\left(x + y\right)}$$I've seen it stated that \(x^n+y^n \) cannot be factored if \(n\) is even with \(x^2+y^2 \) and \(x^4+y^4\) cited as examples. See Figure 1.


Figure 1: source

This is certainly true for \(n=2\) and \(n=4\) and in fact in any power of 2 (8, 16, 32 etc.) but otherwise any composite number will contain an odd factor e.g. 6 = 2 x 3 and thus we can write \(x^6+y^6\) as \( (x^2)^3+(y^2)^3 \) and it is a sum of odd powers! In fact, it is a sum of two cubes:$$x^6+y^6={\left(x^{4} - x^{2} y^{2} + y^{4}\right)} {\left(x^{2} + y^{2}\right)}$$Now it might be thought that this is a special case, since any \(n\) that is a power of three can be written as a sum of two cubes. So let's consider \(x^{10}+y^{10}\). We jump over \(x^8+y^8\) because we know that it can't be factored. $$\ \begin{align} ( x^{10}+y^{10}&=(x^2)^5+(y^2)^5\\ &= {\left(x^{8} - x^{6} y^{2} + x^{4} y^{4} - x^{2} y^{6} + y^{8}\right)} {\left(x^{2} + y^{2}\right)} \end{align} $$In general, whatever \(m\) divides the even index to produce an odd number, then \(x^m+y^m\) will appear as a factor (this \(m\) must be a multiple of 2). For example, in the case of \(x^{48}+y^{48}\), \(x^{16}+y^{16}\) must be a factor.$$\begin{align} x^{48}+y^{48} &= (x^{16})^3+(y^{16})^3\\&={\left(x^{32} - x^{16} y^{16} + y^{32}\right)} {\left(x^{16} + y^{16}\right)} \end{align}$$DIFFERENCE OF ODD AND EVEN POWERS

In the case of \(x^n-y^n\), the factorisation is:$$x^n-y^n=(x-y)(x^{n-1}+x^{n-2}y+ \dots + xy^{n-2} + y^{n-1} \text{ for }n\geq 1$$If \(n \) is odd, then \(x-y\) is a factor and if \(n\) is even, then \(x-y\) and \(x+y\) are factors.$$\begin{align} x^7-y^7&={\left(x^{6} + x^{5} y + x^{4} y^{2} + x^{3} y^{3} + x^{2} y^{4} + x y^{5} + y^{6}\right)} {\left(x - y\right)}\\x^8-y^8&={\left(x^{4} + y^{4}\right)} {\left(x^{2} + y^{2}\right)} {\left(x + y\right)} {\left(x - y\right)} \end{align}$$IN CONCLUSION

  • \(x^n- y^n \) can always be factored
  • \(x^n+y^n\) can be factored provided \(n\) is not a power of 2.

Saturday 24 April 2021

Riesel and Sierpinski Numbers

In mathematics, a Riesel number is an odd natural number \(k\) for which \(k \times 2^n-1 \) is composite for all natural numbers \(n\). This is sequence A101036 in the OEIS. I have encountered numbers of this form before but in a different context. In a post of June 27th 2016, I wrote about Proth-like numbers that are also of the form \(k \times 2^n-1 \) and that are prime for certain values of \(k\) and \(n\). Some of these prime-producing combinations of \(k\) and \(n\) are listed on this website: 

http://www.prothsearch.com/riesel2.html

Figure 1 shows a screenshot from the opening page.


Figure 1

For example, if \(k=121\), then the initial values of \(n\) that produce primes are as follows:
1, 3, 21, 27, 37, 43, 91, 117, 141, 163, 373, 421, 1581, 2035, 10701, 18931, 21307, 51195, 64579, 156541, 302097, 334257, 368059, 383061, 410131, 494317, 541621, 990219, ...
The reason that I referred to these sorts of numbers as Proth-like is that the actual Proth numbers are of the form \(k \times 2^n+1 \) and the primes that are produced by suitable combinations of \(k\) and \(n\) are referred to as Proth primes.

Hans Ivar Riesel: biography

Riesel numbers are clearly the opposite because we are only interested in values of \(k\) that always produce composite numbers, no matter what the value of \(n\). It should be noted that a Riesel number does not refer to the prime itself but to the coefficient of \(2^n\). The currently known Riesel numbers are shown below and constitute OEIS A101036:
509203, 762701, 777149, 790841, 992077, 1106681, 1247173, 1254341, 1330207, 1330319, 1715053, 1730653, 1730681, 1744117, 1830187, 1976473, 2136283, 2251349, 2313487, 2344211, 2554843, 2924861, ...

To quote from Wikipedia:

In 1956, Hans Riesel showed that there are an infinite number of integers \(k\) such that \(k\times 2^n-1 \) is not prime for any integer \(n\). He showed that the number 509203 has this property, as does 509203 plus any positive integer multiple of 11184810. The Riesel problem consists in determining the smallest Riesel number. Because no covering set has been found for any \(k\) less than 509203, it is conjectured to be the smallest Riesel number.

To check if there are \(k < 509203\), the Riesel Sieve project (analogous to Seventeen or Bust for Sierpinski numbers) started with 101 candidate \(k\). As of January 2021, 53 of these \(k\) had been eliminated by Riesel Sieve, PrimeGrid, or outside persons. The remaining 48 values of \(k\) that have yielded only composite numbers for all values of \(n\) so far tested are

2293, 9221, 23669, 31859, 38473, 46663, 67117, 74699, 81041, 93839, 97139, 107347, 121889, 129007, 143047, 161669, 192971, 206039, 206231, 215443, 226153, 234343, 245561, 250027, 315929, 319511, 324011, 325123, 327671, 336839, 342847, 344759, 362609, 363343, 364903, 365159, 368411, 371893, 384539, 386801, 397027, 409753, 444637, 470173, 474491, 477583, 485557, 494743

The most recent elimination was in November 2020, when \(146561 × 2^{11280802} − 1 \) was found to be prime by PrimeGrid. This number is 3,395,865 digits long. As of January 2021, PrimeGrid has searched the remaining candidates up to \(n = 11,300,000\). 

There is also the notion of the covering set in relation to Riesel numbers. To quote again from Wikipedia:

A number can be shown to be a Riesel number by exhibiting a covering set: a set of prime numbers that will divide any member of the sequence, so called because it is said to "cover" that sequence. The only proven Riesel numbers below one million have covering sets as follows:

  • \(509203\times 2^n-1\) has covering set {3, 5, 7, 13, 17, 241}
  • \(762701\times 2^n-1\) has covering set {3, 5, 7, 13, 17, 241}
  • \(777149\times 2^n-1\) has covering set {3, 5, 7, 13, 19, 37, 73}
  • \(790841\times 2^n-1\) has covering set {3, 5, 7, 13, 19, 37, 73}
  • \(992077\times 2^n-1\) has covering set {3, 5, 7, 13, 17, 241}

The concept of Riesel numbers can be extended to bases other than 10 but I won't go into that here. Instead let's consider what constitutes a Sierpinski number. Wikipedia provides this definition:

In number theory, a Sierpiński number is an odd natural number \(k\) such that \( k \times 2^n+1\) is composite for all natural numbers \(n\). In 1960, Wacław Sierpiński proved that there are infinitely many odd integers \(k\) which have this property.


Wacław Sierpiński: biography

The article continues by saying that:

The sequence of currently known Sierpiński numbers constitutes OEIS A076336 begins with:

78557, 271129, 271577, 322523, 327739, 482719, 575041, 603713, 903983, 934909, 965431, 1259779, 1290677, 1518781, 1624097, 1639459, 1777613, 2131043, 2131099, 2191531, 2510177, 2541601, 2576089, 2931767, 2931991, ... 

The number 78557 was proved to be a Sierpiński number by John Selfridge in 1962, who showed that all numbers of the form \(78557 \times 2^n + 1\) have a factor in the covering set {3, 5, 7, 13, 19, 37, 73}. For another known Sierpiński number, 271129, the covering set is {3, 5, 7, 13, 17, 241}. Most currently known Sierpiński numbers possess similar covering sets. 

A number may be simultaneously Sierpiński and Riesel. These are called Brier numbers and constitute OEIS A076335. The smallest five known examples are: 

  • 3316923598096294713661
  • 10439679896374780276373
  • 11615103277955704975673
  • 12607110588854501953787
  • 17855036657007596110949
There's a lot more that could be said but I'll leave it there as the essential ideas have been covered.    

Thursday 22 April 2021

Alternating Series Test

Just lately, I fell to wondering what the sum of the following infinite series was:$$1-\frac{1}{2}+\frac{1}{3}-\frac{1}{4}+\frac{1}{5}-\cdots = \sum_{n=1}^{\infty}(-1)^{n+1} \, \frac{1}{n}$$This can be called the alternating harmonic series. I knew that the harmonic series diverged but I was certain its alternating equivalent was convergent. But what did it converge to? Of course, the answer to such questions is always close at hand but the question had been bouncing around in my head without my doing anything to answer it. Today, I decided to answer it.

It turns out that the question of convergence of this sum can be decided for a much broader category of sums using what's referred to the Alternating Series Test but also Leibniz's test, Leibniz's rule, or the Leibniz criterion. Here is a statement of the test:

A series of the form:$$\sum_{n=0}^{\infty} (-1)^{n} a_n = a_0-a_1 + a_2 - a_3 + \cdots$$where \(a_n\) are all positive (or all negative) is called an alternating series. The alternating series test then says that if |\(a_n\)| decreases monotonically and \( \displaystyle \lim_{n \rightarrow \infty} a_n=0\) then the alternating series converges.

There are plenty of sources that will prove this to be true but I'll just use the result here, namely that the series converges because it satisfies the alternating test criteria. The question remains however, of what the sum converges to. Let's use SageMathCell to find the answer. Figure 1 shows the result.


Figure 1: permalink
$$ \text{Thus we see that }\sum_{n=1}^{\infty}(-1)^{n+1} \, \frac{1}{n}=\ln{2} $$This result is in fact a particular instance of a more general sum:$$x-\frac{x^2}{2}+\frac{x^3}{3}-\frac{x^4}{4}+ \cdots =\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} x^n = \ln (1+x)$$This infinite series is known as the Mercator or Newton-Mercator series and, when \(x=1\) it becomes the alternating harmonic series. The series converges to the natural logarithm (shifted by 1) whenever \( -1<x\leq 1 \). Reference

Again, SageMathCell will generate the correct result as shown in Figure 2.


Figure 2: permalink

It's relatively easy to prove that:$$\ln (1+x)=\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} x^n $$Here is the proof as described in Wikipedia:

Start with the finite geometric series where \( t \ne -1 \):$$\begin{align} \frac{1-(-t)^n}{1+t}&=1-t+t^2-\cdots+(-t)^{n-1}\\
\frac1{1+t}&=1-t+t^2-\cdots+(-t)^{n-1}+\frac{(-t)^n}{1+t}\\
\int_0^x \frac{dt}{1+t}&=\int_0^x \left(1-t+t^2-\cdots+(-t)^{n-1}+\frac{(-t)^n}{1+t}\right)\ dt\\
\ln(1+x)&=x-\frac{x^2}{2}+\frac{x^3}{3}-\cdots+(-1)^{n-1}\frac{x^n}{n}+(-1)^n \int_0^x \frac{t^n}{1+t}\ dt\\
&= \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} x^n \end{align}$$
This is because the remainder term tends to 0 as \( n \to \infty \) if \( -1< x \le 1 \). This is apparent if you graph \( \displaystyle \frac{t^n}{1+t} \) as shown in Figure 3 for \(n=50\).


Figure 3: created in GeoGebra

Thursday 15 April 2021

Anatomy of a Search

As someone who attended high school in the 1960s, I'm still impressed by the mathematical feats that can nowadays be accomplished in seconds and that would have been impossible in that decade. Take for instance, this sequence from the OEIS:


 A258166

Indices of the start of 10 successive distinct digits in the decimal expansion of e (2.718281828...).


My attention was drawn to this sequence because 26310, my diurnal age today, happens to be a member of this sequence. In other words, in the decimal expansion of e there is a run of ten consecutive distinct digits starting at position 26310. Remember that the position count in 2.718 ... begins after the decimal point, so the 7 is in position 1, the 1 is in position 2, the 8 is in position 3 etc. The sequence, up to 26310, runs as follows:
1730, 2031, 2032, 3682, 4655, 5445, 5836, 9756, 10607, 11496, 11497, 11576, 17724, 17951, 18935, 18936, 20948, 21488, 21489, 22519, 26310, ...


I don't think this sequence could have been generated in the 1960s by a lone person like myself with access to just everyday tools like log tables and slide rules. It may have been possible for a researcher who had access to an IBM computer of the day. How can I generate this sequence now in 2021 using readily available tools?

I'm going to use SageMathCell to accomplish the task, using nothing more than an Internet connection and a web browser. Firstly, let's state in general terms what needs to be done:

begin
    generate the decimal expansion of e up to a certain point
    generate a list of all permutations of the digits 1234567890 
    check through successive blocks of ten in the decimal expansion of e 
    record initial position of any block that is in the list of permutations
end

Fortunately, SageMathCell will be able to handle all of these tasks. To generate the decimal expansion of e, we'll use:

str(e.n(digits=26320)) --> 2.71828182845904523536...

Of course, it's not necessary to view this expansion. It's sufficient to let D = str(e.n(digits=26320)) and then the digits are stored in active memory for later use by the program. Remember we need to go ten positions past 26310 so that's the reason for the 26320 limit. 

Now what about all the permutations of the digits 1234567890. There are 10! = 3,628,800 of them which is quite a lot. To find the permutations, it's necessary to separate 1234567890 into its separate digits and then shuffle them in every possible way:

1234567890.digits() --> [0, 9, 8, 7, 6, 5, 4, 3, 2, 1] 

For programming purposes, I'll let ID = 1234567890.digits() 

Permutations(ID) --> lists all 10! arrangements

It's then just a question of picking successive groups of digits in the decimal expansion of e and seeing if they match any of the 3,628,800 permutations. For example, the first group of ten digits would be:

[7, 1, 8, 2, 8, 1, 8, 2, 8, 4] which isn't a match

The next group of ten digits is:

[1, 8, 2, 8, 1, 8, 2, 8, 4, 5] which again isn't a match

The SageMath program will continue creating these groups of ten and trying to find a match. Figure 1 shows the actual code together with a permalink:

Figure 1

The output from this program is exactly as listed in the OEIS. It's interesting to note however, that the members of this sequence often come in pairs:
1730, 2031, 2032, 3682, 4655, 5445, 5836, 9756, 10607, 11496, 11497, 11576, 17724, 17951, 18935, 18936, 20948, 21488, 21489, 22519, 26310, 26311, ...
The program is flexible in that we can search for permutations of 1234567890 in the decimal expansion of other numbers e.g. \( \sqrt{2} \). All that's needed is to replace e with \( \sqrt{2} \). It's also easy to search for permutations of other sets of digits e.g. 24680. All that's needed is to replace 1234567890 with 24680. 

That's how easy it is. The only slightly difficult part is to write the code but the more familiar you become with SageMath the easier it gets.

Saturday 10 April 2021

Unprimeable Composites and Digitally Delicate Primes

I consult Numbers Aplenty on a daily basis and one of the categories always mentioned is that unprimeable numbers. It's one that I have always ignored but a recent mathematical article kindled my interest:

Mathematicians Discovered a New Kind of Prime Number

In new research, mathematicians have revealed a new category of “digitally delicate” prime numbers. These infinitely long primes turn back to composites faster than Cinderella at midnight with a change of any individual digit.

Digitally delicate primes have infinite digits, and changing any digit to any other value bears a composite number outcome instead. To use a more bite-size example, consider 101, which is a prime. Change the digits to 201, 102, or 111, and you have values that are divisible by 3 and therefore compound numbers.

This idea is decades old, so what’s new? Now, mathematicians from the University of South Carolina have established an even more specific niche of the digitally delicate primes: widely digitally delicate primes. These are primes with added, infinite “leading zeros,” which don’t change the original prime, but make a difference as you change the 0s into other digits to test for delicacy.

So instead of 101, consider 000101. That value is prime, and the zeros are just there for show, basically. But if you change the zeros, like 000101 to 100101, now you have a composite number that’s divisible by 3. The mathematicians believe there are infinite widely digitally delicate primes, but so far, they can’t come up with a single real example. They’ve tested all the primes up to 1,000,000,000 by adding leading zeros and doing the math. 

I won't go into the topic of widely digitally delicate primes in this post but will look at digitally delicate primes that form OEIS A050249:


  A050249

Weakly prime numbers (changing any one decimal digit always produces a composite number). Also called digitally delicate primes.


The first few of these sorts of primes are:
294001, 505447, 584141, 604171, 971767, 1062599, 1282529, 1524181, 2017963, 2474431, 2690201, 3085553, 3326489, 4393139, 5152507, 5564453, 5575259, 6173731, 6191371, 6236179, 6463267, 6712591, 7204777, 7469789, 7469797

Clearly these sorts of primes are quite rare. Terence Tao however, has proved that this sequence is infinite. For values 6, 7, 8, 9, 10 of \(k\), the number of terms \(< 10^k \) in this sequence is 5, 35, 334, 3167, 32323. It should be noted that the digits include 0 and so the first number in the sequence, 294001, can become 094001 or simply 94001 which of course is composite.


200 is the first unprimeable number

Unprimeable numbers turn out to be far more numerous and are defined as follows:

A composite number \(n\) is called unprimeable if it cannot be turned into a prime by changing a single digit. 
For example, 144 is not unprimeable, because changing the last digit into a nine we obtain 149, a prime. The number 200 is instead unprimeable (the smallest one), since none of the numbers 201, 203, 207, 205, and 209 are prime and all the other numbers which can be obtained from 200 (say, 300, or 270, or 208) are even, so they are not prime. 
It is easy to prove that unprimeable numbers are infinite, since, for example, all the numbers of the form  \(510+k\cdot 2310\) are unprimeable. Source.

These numbers form OEIS A118118:

 
  A118118

Composite numbers that always remain composite when a single decimal digit of the number is changed.

 The initial members of the sequence are:

200, 204, 206, 208, 320, 322, 324, 325, 326, 328, 510, 512, 514, 515, 516, 518, 530, 532, 534, 535, 536, 538, 620, 622, 624, 625, 626, 628, 840, 842, 844, 845, 846, 848, 890, 892, 894, 895, 896, 898, 1070, 1072, 1074, 1075, 1076, 1078

Notice that 202 is not in the sequence because it can be changed to 002 = 2 which is prime. Otherwise, within a suitable decad, all numbers ending in 0, 2, 4, 5, 6 or 8 will be in the sequence e.g. 320, 322, 324, 325, 326 and 328. Thus the numbers comes in batches within decads that often have wide gaps between them:

  • 200, 204, 206, 208
  • 320, 322, 324, 325, 326, 328
  • 510, 512, 514, 515, 516, 518
  • 530, 532, 534, 535, 536, 538
  • 620, 622, 624, 625, 626, 628
  • 840, 842, 844, 845, 846, 848
  • 890, 892, 894, 895, 896, 898
  • 1070, 1072, 1074, 1075, 1076, 1078

So this post brings together two different but related categories of numbers: 

  • the digitally delicate prime that always changes into a composite number with the alteration of the single digit AND 
  • the unprimeable composite that can never change into a prime by the alteration of a single digit

Friday 9 April 2021

On Non-squashing Partitions

Back on the 19th June 2016, I created a blog post titled Partitions that finished with my saying that the post was "only the briefest of introductions to the topic". Since then I've not delved much deeper into partitions and today's number of 26303, representing my diurnal age, rekindled my interest. The number belongs to OEIS A089054:


  A089054



Solution to the non-squashing boxes problem (version 1).   


The comments say the following:
Given \(n\) boxes labeled \(1 \dots n\), such that box \(k\) weighs \(k\) grams and can support a total weight of \(k \) grams; \(a(n)\) = number of stacks of boxes that can be formed such that no box is squashed.

For 26303, the associated number of boxes is 40. However, let's start with a smaller number of boxes to illustrate what is going on. Figure 1 shows the example of four boxes:


Figure 1

For 4 boxes, there are 14 different ways of stacking boxes so that no box is squashed. See Figure 2.


Figure 2

Note that the null stack, where no boxes are used, is also counted. Up to 26303 (where we are dealing with 40 boxes), the sequence runs (beginning with \(n=0\):
1, 2, 4, 8, 14, 23, 36, 54, 78, 109, 149, 199, 262, 339, 434, 548, 686, 849, 1043, 1269, 1535, 1842, 2199, 2607, 3078, 3613, 4225, 4915, 5700, 6581, 7576, 8686, 9934, 11321, 12871, 14585, 16493, 18596, 20925, 23481, 26303, ...
The figure of 2 for \(n=1\) arises from the fact that there can be a single 1 box or the null box. There is a generating function that will yield these numbers: $$ \frac{B(x)-x}{(1-x)^2} \text{ where } B(x)=1 + \frac{x}{1-x} + \frac{\sum \limits_{k>=1} x^{3 \times 2^{k-1}}}{\prod \limits_{j=0 \dots k} (1-x^{2^j)}}$$Let's test this function out using \(k=1\):$$\begin{align} B(x)&=1+ \frac{x}{1-x}+\frac{x^3}{(1-x)(1-x^2)}\\ \\ \frac{B(x)-x}{(1-x)^2} &=\dfrac{1+ \dfrac{x}{1-x}+\dfrac{x^3}{(1-x)(1-x^2)}-x}{(1-x)^2} \end{align}$$

This does in fact produce the first term 1 because the Taylor series expansion is \(1+3x+6x^2+10x^3+\dots \) but the other coefficients are not relevant and it would be necessary to work out a new polynomial for the case of \(k=2\) and so on. A tedious procedure. Let's just assume it works.

Thus there are 26303 ways to stack 40 boxes so that there is no collapse. Examples are [39, 40], [1, 39, 40], [1, 2, 37, 40] and on and on and on. The whole business is explained in detail in this PDF file by Sloane and Sellers: 


but I haven't the mental stamina to get to the bottom of it all in this post. Suffice to say that I've reconnected with the topic of partitions. 

It should be noted that a traditional partition of 40 would be something like [1, 39] where the elements add to 40. The non-squashing partitions of 40 are different as we've seen and take forms like [39, 40], [1, 39, 40], [1, 2, 37, 40] etc. In these, the totals can be no more than 2 x 40 and so in fact range from 0 to 80. This means that for any number \(n\), the non-squashing partitions of \(n\) are particular partitions of all the numbers ranging from 0 to \(2n\).

To illustrate we can go back to the case of \(n=4\) and list the 14 non-squashing partitions of 4 as being (refer back to Figure 2): 
[4], [3, 4], [1, 3, 4], [1, 2, 4], [1, 4], [2, 4], [3], [2, 3], [1, 2, 3], [1, 3], [2], [1, 2], [1], [ ]

Saturday 3 April 2021

Patterns in Collatz Trajectories

It's my 72nd birthday and I'm 26298 days old. It's a number that seems to have no interesting properties, despite an extensive search. I decided to look at its Collatz trajectory and that turns out to have 77 steps. This led me to consider what other numbers between 1 and 100,000 also have trajectories of this length. Figure 1 shows what I found.


Figure 1: numbers with Collatz trajectories of length 77 steps
in range from 1 to 100,000

The results are interesting. There are an initial three numbers (790, 791, 793) and then a big gap until 4252 is reached. After this there are many numbers with a trajectory of length 77:
4252, 4253, 4254, 4260, 4261, 4262, 4278, 4279, 4289, 4290, 4291, 4295, 4305, 4306, 4307, 4338, 4339, 4350, 4351, 4374, 4375, 4377, 4380, 4381, 4382, 4383, 4409, 4418, 4419, 4423, 4434, 4435, 4494, 4495, 4744, 4746, 4748, 4749, 4752, 4756, 4757, 4758, 4759, 4760, 4762, 4769, 4779, 4783

There is a jump after 4783 to 5279 and 5287 after which there is a very big gap until 25520 is reached, after which there is a steady stream of numbers (with minor gaps) until 31855 is reached. After this, nothing up to the calculation limit of 100,000. There are 439 numbers in total.

Contrast this with numbers that have trajectories of length 76 steps and 78 steps, with 1417 and 908 numbers respectively. See Figures 2.


Figure 2
: numbers with Collatz trajectories of length 76 steps
in range from 1 to 100,000



Figure 3: numbers with Collatz trajectories of length 78 steps
in range from 1 to 100,000

The results for trajectories of length of 76 and 78 steps led me to suspect that there was probably another run of numbers above 100,000 with trajectories of 77 steps. I extended the search up to 200,000 and Figure 4 shows what I found.


Figure 4
: numbers with Collatz trajectories of length 77 steps
in range from 1 to 200,000

In the range up to 200,000, there are 2751 numbers with trajectories of 77 steps. Figures 2, 3 and 4 are nearly identical in their essential features, only differing in where the runs begin and end. Dropping down to numbers with trajectories of length 38 steps, the same pattern recurs. See Figure 5.


Figure 5
: numbers with Collatz trajectories of length 38 steps
in range from 1 to 200,000

I've no idea why these patterns occur and am simply noting them in this post. Thus 26298 turns out to be a number of some interest after all because it led me to discover this pattern. As can be seen from Figure 1 and Figure 4, there are many numbers in the vicinity of 26298 that also have trajectories of 77 steps:

..., 26292, 26293, 26296, 26298, 26300, 26301, 26302, 26305, ...

Of course, looking at the list above, I'm interested to know what the trajectories are for the numbers between 26292 and 26305 that aren't in the list. Here's what I found.
  • 26294 requires 64 steps
  • 26295 requires 64 steps
  • 26297 requires 64 steps
  • 26299 requires 64 steps
  • 26303 requires 64 steps
  • 26304 requires 139 steps
Let's keep this going for a bit longer:
  • 26306 requires 100 steps
  • 26307 requires 100 steps
  • 26308 requires 139 steps
  • 26309 requires 139 steps
  • 26310 requires 139 steps
Obviously, this is just a small sample of the behaviour of the non-77 step numbers surrounding 26298. More analysis is needed before any generalisations can be made but oddly, whether the number is odd or even, it doesn't seem to make much difference. This is in spite of the fact that a number like 26294 --> 13147 while 26295 --> 78886. However, if go another step see that 13147 --> 39442 while 78886 --> 39443 and the numbers are paired again.

Friday 2 April 2021

Luhn Primes


Today, the day before my 72nd birthday, I turned 26297 days old. Now 26297 is a prime number and in my search to find some interesting properties relating to this number, I stumble upon a book titled "Various Arithmetic Functions and their Applications" by Octavian Cira and Florentin Smarandache. What I found was that:$$26297^4+79262^4=39947578799194466417$$The rather large number on the right hand side of the above equation is also prime and this qualifies 26297 as a Luhn prime of the fourth order. However, I'm getting ahead of myself. Let's clarify what a Luhn prime is by quoting from the aforementioned book:

The number 229 is the smallest prime which summed with its inverse gives also a prime. Indeed, 1151 is a prime, and 1151 = 229 + 922. The first to note this special property of 229, on the website Prime Curios, was Norman Luhn (9 Feb. 1999), [Luhn, 2013, Caldwell and Honacher Jr., 2014].

These Luhn primes of the first rank, although simply called Luhn primes, constitute OEIS A061783:

 
 A061783



Luhn primes: primes \(p\) such that \(p + (p \text{ reversed }) \) is also a prime.          

 The sequence runs:

229, 239, 241, 257, 269, 271, 277, 281, 439, 443, 463, 467, 479, 499, 613, 641, 653, 661, 673, 677, 683, 691, 811, 823, 839, 863, 881, 20011, 20029, 20047, 20051, 20101, 20161, 20201, 20249, 20269, 20347, 20389, 20399, 20441, 20477, 20479, 20507, ...

The authors of the book ask the question as to whether there are Luhn primes of second rank? Their answer is yes, indeed. 23 is a Luhn prime number of second rank because 1553 is a prime and we have \(1553 = 23^2 + 32^2\). The sequence of such numbers forms OEIS A304390:


 A304390

Prime numbers \(p\) such that \(p^2\) + \( (p \text{ reversed })^2 \) is also prime.     

This sequence runs:

23, 41, 227, 233, 283, 401, 409, 419, 421, 461, 491, 499, 823, 827, 857, 877, 2003, 2083, 2267, 2437, 2557, 2593, 2617, 2633, 2677, 2857, 2887, 2957, 4001, 4021, 4051, 4079, 4129, 4211, 4231, 4391, 4409, 4451, 4481, 4519, 4591, 4621, 4639, 4651, 4871, 6091, 6301, 6329, 6379, 6521, 6529, 6551, ...

Interestingly there doesn't seem to be any Luhn primes of the third rank. However, as we've seen Luhn primes of the fourth order are possible and my diurnal age, 26297, is an example. These particular primes are not listed in the OEIS but, copying from the book, here is a list up to 26297:

23, 43, 47, 211, 233, 239, 263, 419, 431, 487, 491, 601, 683, 821, 857, 2039, 2063, 2089, 2113, 2143, 2203, 2243, 2351, 2357, 2377, 2417, 2539, 2617, 2689, 2699, 2707, 2749, 2819, 2861, 2917, 2963, 4051, 4057, 4127, 4129, 4409, 4441, 4481, 4603, 4679,  4733, 4751, 4951, 4969, 4973, 6053, 6257, 6269, 6271, 6301, 6311, 6353, 6449, 6547, 6551, 6673, 6679, 6691, 6803, 6869, 6871, 6947, 6967, 8081, 8123, 8297, 8429, 8461, 8521, 8543, 8627, 8731, 8741, 8747, 8849, 8923, 8951, 8969, 20129, 20149, 20177, 20183, 20903, 20921, 21017, 21613, 21661, 21727, 22073, 22133, 22171, 22817, 22853, 22877, 23531, 23767, 23827, 24251, 24421, 24481, 25307, 25321, 25343, 26171, 26267, 26297, ...

Thus they have the property that:


 OEIS candidate? 


Prime numbers \(p\) such that \(p^4\) + \( (p \text{ reversed })^4 \) is also prime.     

The authors make the comment that:

Up to \(3 \times 10^4\), the numbers: 23, 233, 419, 491, 857, 2617, 4051, 4129, 4409, 4481, 6301, 6551, 6871, 8543, 21727, 21803, 21937, 22133, 23227, 23327, 24527, 28297, 29063 are Luhn prime numbers of 2nd and 4th rank. The question of whether there are Luhn primes of rank higher than 4 is posed as a question in the book but is not answered.

The book will continue to prove useful in the future I'm sure. Here is some information about the book and its contents:

Over 300 sequences and many unsolved problems and conjectures related to them are presented herein. These notions, definitions, unsolved problems, questions, theorems corollaries, formulae, conjectures, examples, mathematical criteria, etc. on integer sequences, numbers, quotients, residues, exponents, sieves, pseudo-primes, squares, cubes, factorials, almost primes, mobile periodicals, functions, tables, prime square factorial bases, generalised factorials, generalised palindromes and so on, have been extracted from the Archives of American Mathematics (University of Texas at Austin) and Arizona State University (Tempe): "The Florentin Smarandache papers" special collections, and Arhivele Statului (Filiala Vâlcea & Filiala Dolj, Romania).

This book was born from the collaboration of the two authors, which started in 2013. The first common work was the volume "Solving Diophantine Equations", published in 2014. The contribution of the authors can be summarised as follows: Florentin Smarandache came with his extraordinary ability to propose new areas of study in number theory, and Octavian Cira - with his algorithmic thinking and knowledge of Mathcad.