Sunday, 27 November 2022

Polygonal Prism Number Confusion

Despite the fact that I've encountered figurate numbers many times during my research, I found myself getting confused by them and so this post is meant to clarify and document my understanding. Even though the title of this post relates to 3-dimensional prisms, I'm going to start in two dimensions with octagonal numbers. Figure 1 shows how the successive octagonal numbers are generated.


Figure 1

The formula associated with this visual process is \(3n^2-2n=n(3n-2)\) which yields the so-called octagonal numbers that form OEIS A000567:


 A000567



Octagonal numbers: \(n(3n-2)\). Also called star numbers.         
             

The initial members of the sequence are:

0, 1, 8, 21, 40, 65, 96, 133, 176, 225, 280, 341, 408, 481, 560, 645, 736, 833, 936, 1045, 1160, 1281, 1408, 1541, 1680, 1825, 1976, 2133, 2296, 2465, 2640, 2821, 3008, 3201, 3400, 3605, 3816, 4033, 4256, 4485, 4720, 4961, 5208, 5461

Now we can move on to three dimensions and consider the octagonal prism shown in Figure 2.


Figure 2

The octagonal prism numbers are formed simply by adding successive layers to the octagonal numbers as evidenced by the formula \(3n^3-2n^2=n(3n^2-2n)\) where we can see the octagonal number is multiplied by the number of layers. These numbers form OEIS A100176:


 A100176

Structured octagonal prism numbers.   
                                             

The initial members of the sequence are:

1, 16, 63, 160, 325, 576, 931, 1408, 2025, 2800, 3751, 4896, 6253, 7840, 9675, 11776, 14161, 16848, 19855, 23200, 26901, 30976, 35443, 40320, 45625, 51376, 57591, 64288, 71485, 79200, 87451, 96256, 105633, 115600, 126175, 137376, 149221

Thus it would seem that all the prism numbers can be calculated simply by multiplying the related two dimensional figurate number by the number of layers. Thus the formula for the hexagonal numbers is 
\( 2n^2-n \) and thus the formula for the hexagonal prism numbers would be \( n(2n^2-n)\). Oops, not so fast!

The formula for hexagonal prism numbers is \((n + 1)(3n^2 + 3n + 1) \) as stated in OEIS A005915. So what's going on. The problem would seem to lie in the use of the term "structured". OEIS A100176 refers to "structured" octagonal prism numbers and not octagonal prism numbers. In fact, a search of structured hexagonal prism numbers brings up OEIS A015237 whose members do conform with the formula \( n(2n^2-n)\).

This leads to the obvious question. What is the difference between a structured hexagonal or octagonal prism and a simple hexagonal or octagonal prism? So far I've not been able to find an answer to what seems like a straightforward question. I'll keep investigating. Meanwhile the concept of a structured polygonal prism and the numbers associated with it are easy enough to understand.

The general formula for the \(n\)-th polygonal number in a polygon of with \(s\) sides is:$$P(s,n)=\frac {(s-2)n^2-(s-4)n}{2}$$Checking this out we see that when \(s=6\):$$ \begin{align} P(6,n)&=\frac {4n^2-2n}{2}\\&=2n^2-n \end{align}$$which checks out with what was shown earlier. When \(s=8\), we have:$$ \begin{align} P(8,n)&=\frac {6n^2-4n}{2}\\&=3n^2-2n \end{align}$$which again checks out. Thus the general formula for \(n\)-th structured polygonal prism number in a prism with cross-section polygon of \(s\) sides is:$$ PP(s,n)=\frac {(s-2)n^3-(s-4)n^2}{2}$$So let's calculate the structured duodecagonal prism number when substituting \(s=12\). The result is:

1, 24, 99, 256, 525, 936, 1519, 2304, 3321, 4600, 6171, 8064, 10309, 12936, 15975, 19456, 23409, 27864, 32851, 38400, 44541

This is a sequence not listed in the OEIS and so it shall remain.

Monday, 21 November 2022

Tau Numbers

Having just posted about anti-tau numbers, I realised that I hadn't yet made a dedicated post about tau numbers and in fact only mentioned them briefly in a post titled Arithmetic Numbers. In this post, I'll address that deficiency. 

Wikipedia has the following definition:

A refactorable number or tau number is an integer \(n\) that is divisible by the count of its divisors, or to put it algebraically, \(n\) is such that \( \tau (n) \mid n \). The first few refactorable numbers are listed in OEIS A033950 as:

1, 2, 8, 9, 12, 18, 24, 36, 40, 56, 60, 72, 80, 84, 88, 96, 104, 108, 128, 132, 136, 152, 156, 180, 184, 204, 225, 228, 232, 240, 248, 252, 276, 288, 296, ...

For example, 18 has 6 divisors (1 and 18, 2 and 9, 3 and 6) and is divisible by 6. There are infinitely many refactorable numbers.

Up to 100,000, there are 5257 tau numbers representing 5.257% of the range. However, the article points out that these numbers have a natural density of zero. Another Wikipedia article explains what is meant by this term:

In number theory, natural density (also referred to as asymptotic density or arithmetic density) is one method to measure how "large" a subset of the set of natural numbers is. It relies chiefly on the probability of encountering members of the desired subset when combing through the interval [1, \(n\)] as \(n\) grows large.

Intuitively, it is thought that there are more positive integers than perfect squares, since every perfect square is already positive, and many other positive integers exist besides. However, the set of positive integers is not in fact larger than the set of perfect squares: both sets are infinite and countable and can therefore be put in one-to-one correspondence. Nevertheless if one goes through the natural numbers, the squares become increasingly scarce. The notion of natural density makes this intuition precise for many, but not all, subsets of the naturals (see Schnirelmann density, which is similar to natural density but defined for all subsets of \( \mathbb{N} \).

If an integer is randomly selected from the interval [1, \(n\)], then the probability that it belongs to A is the ratio of the number of elements of A in [1, \(n\)] to the total number of elements in [1,\( n\)]. If this probability tends to some limit as \(n\) tends to infinity, then this limit is referred to as the asymptotic density of A. This notion can be understood as a kind of probability of choosing a number from the set A. Indeed, the asymptotic density (as well as some other types of densities) is studied in probabilistic number theory.

It has been proven that there are no three consecutive integers that are all tau numbers. They can appear in pairs however, although not often. For example, up to 100,000, there are only 13 such pairs. These are:

(1, 2), (8, 9), (1520, 1521), (50624, 50625), (62000, 62001), (103040, 103041), (199808, 199809), (221840, 221841), (269360, 269361), (463760, 463761), (690560, 690561), (848240, 848241), (986048, 986049)

Take the last pair as an example:

\(986048 = 2^6 \times 7 \times 31 \times 71\) with \(56\) divisors such that \( 56 \mid 986048= 17608\)

\(986049 = 3^2 \times 331^2\) with \(9\) divisors such that \(9 \mid 986049= 109561\)

Whether there are an infinite number of such pairs is not known. Numbers Aplenty states that the smallest Pythagorean triple of tau numbers is (40, 96,104) which is not a primitive triple because it is a multiple of (5, 12, 13).  No one knows if there is a primitive triple.

Up to one million, there are 60 palindromic tau numbers. They are:

[1, 2, 8, 9, 88, 232, 252, 424, 444, 636, 808, 828, 2772, 4224, 12321, 21512, 21612, 23032, 23832, 24642, 25352, 25452, 27372, 29292, 40104, 40904, 42324, 42424, 42624, 44244, 46164, 46264, 46464, 48084, 48384, 48584, 48684, 61416, 61816, 63036, 63636, 65856, 67476, 67576, 69396, 69896, 80508, 82428, 84248, 84948, 86168, 86868, 88188, 88488, 216612, 270072, 423324, 426624, 468864, 486684]

Again, up to one million, there are also 2731 non-palindromic tau numbers whose reversals are also tau numbers. The first such number is 80 with reversal 8. The initial members of this sequence are:

80, 276, 288, 468, 480, 672, 864, 880, 882, 1440, 1656, 2000, 2025, 2148, 2160, 2176, 2178, 2196, 2320, 2388, 2700, 2988, 4044, 4050, 4068, 4080, 4240, 4284, 4404, 4668, 4824, 4856, 4860, 4896, 5202, 5220, 6561, 6584, 6712, 6720, 6912, 6984, 8080, 8100, 8412, 8604, 8649, 8664, 8712, 8832, 8892, 9468, 10000, ... permalink

It should be noted that \( \tau(n)=\sigma(n,0)\) and so this function can be used as an alternative to len(divisors(\(n\))) in any calculations.

There's an interesting history associated with the term refactorable number. To quote again from the Wikipedia article:

First defined by Curtis Cooper and Robert E. Kennedy where they showed that the tau numbers have natural density zero, they were later rediscovered by Simon Colton using a computer program he had made which invents and judges definitions from a variety of areas of mathematics such as number theory and graph theory. Colton called such numbers "refactorable". While computer programs had discovered proofs before, this discovery was one of the first times that a computer program had discovered a new or previously obscure idea. Colton proved many results about refactorable numbers, showing that there were infinitely many and proving a variety of congruence restrictions on their distribution. Colton was only later alerted that Kennedy and Cooper had previously investigated the topic.

Note that \(\tau\) is sometimes used to refer to \(2 \times \pi\) but that usage has nothing to do with this post. 

Anti-tau Numbers

I was familiar with what a tau number was, the definition being that it is an integer divisible by its number of its divisors.  Tau is the divisor function and returns the number of divisors of an integer e.g. \( \tau(6)=4\) because 6 has four divisors (1, 2, 3 and 6). However, 6 is not a tau number because 4 does not divide 6 without remainder.

In general, we can say that a number \(n\) is a tau number if \( \tau(n)|n\). 12 is a tau number because \( \tau(12) =6\) and \(6|12=2\). An alternative term, refactorable number, can be used for tau numbers (see Wikipedia entry). What then is an anti-tau number? Well, it turns out to be a number \(n\) such that \( \text{gcd}(n,\tau(n))=1\). These numbers comprise OEIS A046642.


 A046642

Numbers \(k\) such that \(k\) and number of divisors \( \text{d}(k)\) are relatively prime. 
                   

Note that \( \text{d}(k)\) is sometimes used in place of \( \tau(k) \). All odd prime numbers will be anti-tau numbers because they have two divisors and 2 does not divide them. An example of an anti-tau number is 15 because it has four divisors (1, 3, 5 and 15) and gcd(15, 4) = 1. These numbers are quite frequent. There are 18080 in the range up to 40,000, representing over 45% of all the numbers in the range. The initial members are:

1, 3, 4, 5, 7, 11, 13, 15, 16, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 47, 49, 51, 53, 55, 57, 59, 61, 64, 65, 67, 69, 71, 73, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 100, 101, 103, 105, 107, 109, 111, 113, 115, 119, 121, 123, 125, 127, 129, 131

Notice that all even anti-tau numbers are square numbers (4, 16, 64, 100, 196, 256, 484, 676, 784, 1024 etc.) of the form \(4k^2\) where \(k\) is a positive even integer. However, not all even values of \(k\) produce anti-tau numbers. The initial values of \(k\) are 2, 4, 8, 10, 14, 16,  22, ...

By contrast, tau numbers are less common. In the range up to 100,000, there are 5257 of them representing 5.257% of the range. The anti-tau numbers were brought to my attention by one of the properties of the number representing my diurnal age, 26895, qualifying it for membership of OEIS A341780:


 A341780

Starts of runs of 3 consecutive anti-tau numbers (A046642).     
                  


Let's look at 26895, 26896 and 26897 to confirm that this is true:
  • 26895 = 3 x 5 x 11 x 163 with 16 divisors and 16 does not divide the number
  • 26896 = 2^4 x 41^2 with 15 divisors and 15 does not divide the number
  • 26897 = 13 x 2069 with 4 divisors and 4 does not divide the number
Despite how common anti-tau numbers are, these runs of three (the maximum possible) are not that frequent. The problem is that the runs are of the form odd-even-odd and the even numbers must be of the form \(4k^2\) as mentioned earlier. It is these relatively sparse even anti-tau numbers that make these runs less common than might be expected. Notice how \(26896 = 4 \times 82^2\). There are only 69 such numbers in the range up to 100,000. Here is the list:

3, 15, 195, 255, 483, 783, 1023, 1155, 1295, 1443, 1599, 2703, 3363, 4623, 4899, 5183, 6399, 6723, 7395, 7743, 8463, 8835, 10815, 11235, 11663, 12099, 12543, 15375, 16383, 16899, 17955, 18495, 20163, 24963, 25599, 26895, 27555, 31683, 33855, 35343, 36099, 37635, 38415, 40803, 44943, 45795, 46655, 47523, 52899, 53823, 55695, 56643, 61503, 62499, 64515, 65535, 70755, 71823, 73983, 80655, 81795, 82943, 85263, 87615, 88803, 91203, 92415, 94863, 96099

Here is a permalink that will confirm all the above results.

Sunday, 20 November 2022

Jupyter Notebook

I finally got around to installing SageMath on my laptop that is running Linux Mint. The installation was quite easy via this LInux Community website. I regularly use SageMathCell which is a free online instance of SageMath. It's quick and responsive but it will timeout if the calculations take too long.

Such was the case when I set out to calculate the weird numbers up to 40,000 using SageMathCell. The algorithm that I had written timed out. Figure 1 shows the algorithm that I wrote:

Figure 1

In reference to the algorithm, it's known that only abundant numbers can be weird and so I rule them out from the start. After that I simply look at all the proper subsets of the set of divisors to see if any of them sum to the number. If one of them does, then the number is pseudoperfect and we move on. It's the time taken to sum of all the elements in the subsets that is causing the algorithm to time out.

I hoped that by setting up the Jupyter notebook I wouldn't run into this timing out problem. The algorithm would use my computer's resources for as long as it took. As of writing this post, the algorithm has been chugging away for over six and a half hours. My laptop has four cores and one of them is always at 100%, though not always the same one. Figure 2 shows the situation.


Figure 2

Figure 3 shows the algorithm in the Jupyter worksheet. The black dot to the right of SageMath 9.0 at the top of the page indicates that the program is running. I find it hard to believe that the calculations haven't yet completed but I'll leave it running in the hope that it does eventually terminate.


Figure 3

There are of course ways to make this algorithm more efficient. As this source states:

All the known weird numbers are even ... a weird number multiplied by a prime larger than its sum of divisors is again weird, so there are infinitely many weird numbers. Primitive weird numbers are those which do not have a weird proper divisor. The initial ones are:

70, 836, 4030, 5830, 7192, 7912, 9272, 10792, 17272, 45356, 73616, 83312, 91388, 113072, 243892, 254012, 338572, 343876, 388076, 519712, 539744, 555616, 682592, 786208, 1188256, 1229152, 1713592, 1901728, 2081824, 2189024, 3963968, 4128448, ...

As I read this, I realised that there was no need to include odd numbers and so the processing time could be halved simply by excluding them. Furthermore, all weird numbers must have at least three distinct prime factors and so this condition could be included as well to speed up calculations. I've adjusted the algorithm in the Jupyter notebook  accordingly and restarted the calculation. See Figure 4. 


Figure 4

Actually, looking at the number of subsets involved, it's not surprising that the calculations are taking forever. Here are some examples of the numbers of subsets involved for certain numbers involved:

120 --> 32768

180 --> 131072

240 --> 524288

360 --> 8388608

720 --> 536870912

840 --> 2147483648

I had no idea that the numbers were of that magnitude.

Of course, the advantage of the notebook is that it accommodates input of data which is not possible in SageMathCell. See Figure 5.


Figure 5

Now that I have SageMath installed on my laptop I'm sure that I'll make more use of it.

Thursday, 17 November 2022

Number + Reversal

I was exploring the sum of numbers and their reversals and discovered something puzzling. Specifically I was looking at how many numbers and their reversals, when added together, produce a prime number. In the range up to 10, there is only one number and that is 1 because 1+1=2. In the range up to 100, there is 1 and 10 because 10 + 1 = 11. In the range up 1000, there are 139 numbers (and thus 13.91%). They are:

1, 10, 100, 116, 118, 140, 142, 146, 158, 166, 170, 172, 178, 182, 188, 190, 196, 215, 217, 229, 239, 241, 245, 257, 265, 269, 271, 277, 281, 287, 295, 299, 314, 316, 328, 338, 340, 344, 356, 364, 368, 370, 376, 380, 386, 394, 398, 413, 415, 427, 437, 439, 443, 455, 463, 467, 469, 475, 479, 485, 493, 497, 499, 512, 514, 526, 536, 538, 542, 554, 562, 566, 568, 574, 578, 584, 592, 596, 598, 611, 613, 625, 635, 637, 641, 653, 661, 665, 667, 673, 677, 683, 691, 695, 697, 710, 712, 724, 734, 736, 740, 752, 760, 764, 766, 772, 776, 782, 790, 794, 796, 811, 823, 833, 835, 839, 851, 863, 865, 871, 875, 881, 889, 893, 895, 910, 922, 932, 934, 938, 950, 962, 964, 970, 974, 980, 988, 992, 994

However, in the range up to 10,000, there are also 139 numbers which means that no new numbers have been added (after 994, the next number is 10012). I checked and rechecked my algorithm but could find no error. It must mean that no four digit number when added to its reverse can produce a prime number. This is in fact true and can be demonstrated by considering a four digit number \(abcd\) and its reverse \(dcba\):$$1000a+100b+10c+d +1000d+100c+10b+a=1001a+110b+110c+1001d$$Each coefficient is divisible by 11 because 1001 = 7 x 11 x 13 and 110 = 2 x 5 x 11. This came as quite a surprise to me. When we check in the range up to 100,000, we find that there are 8428 numbers but again when we extend the range to one million, there are still only 8428. This means that all six digits numbers added to their reversals cannot produce primes. The reason is the same as for the four digit numbers. We find that in the range from 10,000 to 100,000, the numbers that produce primes account for about 9.21% of the total. 

Thus we could summarise: for numbers with \(n\) digits where \(n\)=1, 2, 3, ... the numbers that, when added to their reversals produce primes, total 1, 2, 139, 139, 8428, 8428, ... . I suspect this inability of numbers with an even number of digits (from 4 up) to form primes continues although SageMathCell times out when attempting a range up to ten million. Let's use the three digit numbers to understand what's going on with the numbers that have an odd number of digits. For a number \(abc\) and its reverse \(cba\) we have:$$100a+10b+c+100c+10b+a=101a+20b+101c$$The situation now is quite different because 101 and 20 have no factors in common and the former is in fact a prime number. Thus it is possible for some three digits numbers and their reverses to form prime numbers.

Let's go further and consider the five digit numbers using \(abcde\) and \(edcba\). We have:$$10000a+1000b+100c+10d+e+10000e+1000d+100c+10b+a\\=10001a+1010b+200c+1010d+10001e$$Again the coefficients have no factors in common and so it is possible for prime numbers to arise. The first such number is 10012 which, when added to its reverse 21001, gives the prime number 31013. The final five digit number is 99998 which, when added to its reverse 89999, gives the prime number 189997.

Monday, 14 November 2022

Product Sum Ratios

I'm surprised I've not made a post about this topic before. The topic concerns the result when the product of the digits of a number is divided by the sum of its digits. Of interest is:

  • when is the result of this division an integer?
  • what numbers are associated with records in the size of this integer?
Clearly 1 will start the ball rolling with a record of 1 but after that the next number is 36 with a product of 18 and a sum to 9, giving a record of 2. 66 is next with a product of 36 and a sum of 12, giving a record of 3. Figure 1 shows a list of the record numbers up 10,000 followed by a plot of these numbers (Figure 2). 


Figure 1: permalink


Figure 2: 
permalink

Extending out to 100,000, Figure 3 shows an extended table and Figure 4 shows a plot of the full range of record-breaking numbers.


Figure 3: permalink


Figure 4: 
permalink

I won't show a table of results up to one million but here are the 59 record-breaking numbers (permalink):

1, 36, 66, 88, 257, 268, 279, 369, 459, 578, 579, 678, 789, 999, 2589, 2688, 2799, 3699, 3789, 4599, 4689, 4789, 5788, 5889, 7889, 8888, 18999, 25889, 26789, 26888, 27788, 28899, 37899, 38889, 45999, 46899, 47799, 47889, 55899, 56889, 57789, 58999, 78999, 257899, 258889, 267999, 277899, 278889, 367899, 377889, 378888, 457899, 459999, 489999, 588999, 678999, 688899, 778899, 778999

The results for the final number 778999 are:$$ \frac{ 285768} {49} =5832$$Figure 5 shows a plot of these numbers.


Figure 5: permalink

These numbers define OEIS A240520 that clearly goes on forever:


 A240520

Numbers that set a new integer record for the ratio between the product and the sum of their digits



Interestingly, if the search is extended for numbers up to two million, only one new number is added and that is 1899999 with a digit product of 472392 and a sum of 54, giving the integer 8748 as the result.

Extending the search to three million, we get four new numbers.


Figure 6: permalink

The plot of the full range of numbers is shown in Figure 7.


Figure 7: permalink

What we see in Figure 7 is that 1899999 is very much a singleton, sitting there is splendid isolation. This is even more evident when the search is extended to four million. Three new numbers appear (Figure 8) but they are close together (Figure 9). 


Figure 8: permalink


Figure 9: permalink

Saturday, 12 November 2022

Divisor Runs

 My diurnal age today, 26885, is a member of OEIS A006601:


 A006601

Numbers \(k\) such that \(k\), \(k+1\), \(k+2\) and \(k+3\) have the same number of divisors.



This means that 26885, 26886, 26887, 26888 and 26889 have the same number of divisors. Let's check that this is the case:

26885 = 5 x 19 x 283 and has 8 divisors
26886 = 2 x 3 x 4481 and has 8 divisors
26887 = 7 x 23 x 167 and has 8 divisors
26888 = 2^3 x 3361 and has 8 divisors

Let's not forget the rule for determining the number of divisors from the factorisation: add one to the index of each prime factor and then multiply them together. Runs of four numbers with the same number of divisors are rare. 

Below are listed the numbers up to one million, all members of the OEIS sequence (permalink). There are only 1171 of them, representing 0.1171% of the numbers in the range. 

242, 3655, 4503, 5943, 6853, 7256, 8392, 9367, 10983, 11605, 11606, 12565, 12855, 12856, 12872, 13255, 13782, 13783, 14312, 16133, 17095, 18469, 19045, 19142, 19143, 19940, 20165, 20965, 21368, 21494, 21495, 21512, 22855, 23989, 26885, 28135, 28374, 28375, 28376, 29605, 30583, 31735, 31910, 32005, 32792, 33062, 33608, 33845, 34069, 36392, 37256, 40311, 40312, 41335, 42805, 42806, 43304, 43526, 43766, 44213, 45686, 45733, 47845, 48054, 49147, 49765, 50582, 50583, 51752, 54103, 54585, 54966, 55063, 55254, 55255, 55976, 56343, 58952, 59815, 60231, 60232, 60663, 60664, 61142, 62343, 65334, 66952, 67015, 68104, 69303, 71095, 73927, 74053, 76262, 76982, 77432, 78535, 78872, 79094, 79095, 79591, 80726, 82855, 84469, 86887, 87655, 87656, 87896, 90181, 90182, 90183, 91495, 93063, 94262, 94645, 95384, 95414, 95512, 95845, 95846, 97255, 98102, 98984, 99655, 99656, 100711, 100952, 101125, 103352, 103621, 103622, 104222, 104744, 104870, 105301, 107365, 108902, 109191, 109765, 109766, 112567, 113942, 115591, 115592, 115912, 116965, 117032, 118069, 118261, 118615, 118923, 120727, 120728, 120965, 121045, 121046, 122151, 122152, 122871, 122872, 123944, 124663, 125335, 129829, 130135, 131815, 133624, 134582, 136375, 136825, 139863, 141654, 142454, 142455, 142806, 142807, 143365, 145352, 146936, 151285, 152102, 152552, 152630, 152631, 153461, 153543, 153703, 153992, 157493, 157494, 157495, 157910, 158216, 158342, 160934, 162295, 164982, 165542, 166791, 167671, 169112, 169141, 169813, 171893, 171894, 171895, 171896, 172501, 173893, 173912, 174054, 174055, 174872, 175143, 175144, 178086, 178087, 180901, 180902, 180965, 180966, 180967, 180968, 181207, 182215, 183205, 183206, 183554, 183685, 184327, 184328, 185815, 186231, 186951, 186952, 188293, 188294, 191943, 191944, 192728, 194695, 197463, 198776, 198806, 199111, 199112, 199255, 199733, 199832, 201512, 201943, 203432, 203621, 204323, 204324, 204806, 206390, 206552, 210133, 210134, 210135, 211592, 212005, 212006, 214885, 217144, 217526, 218695, 219063, 220232, 220405, 223687, 223861, 223976, 224005, 224776, 225463, 225464, 226792, 227576, 229015, 229352, 229685, 230167, 230869, 231413, 233942, 234615, 235112, 235495, 235496, 236006, 236245, 236246, 236792, 237031, 237063, 238694, 240904, 243415, 243445, 244742, 246294, 246631, 246632, 248311, 248504, 249445, 249512, 251751, 251752, 252967, 253014, 253015, 258008, 259205, 261734, 261992, 262661, 262932, 263765, 263766, 264296, 264952, 266485, 266869, 267655, 268021, 268933, 269912, 270181, 270613, 271526, 272455, 273368, 274088, 277543, 277624, 279302, 279542, 280230, 280712, 282055, 282245, 282584, 283496, 284581, 285413, 287029, 287704, 287814, 288085, 290981, 291781, 292853, 293029, 294085, 295014, 295015, 295352, 296453, 298694, 298695, 298696, 298903, 299863, 301062, 301189, 301622, 302103, 304262, 304675, 305335, 306086, 306631, 306632, 306805, 307254, 307255, 307285, 307445, 308342, 309415, 309416, 309655, 309656, 309830, 310503, 310808, 312151, 312152, 316326, 319765, 321304, 321543, 322214, 324662, 326791, 326792, 328262, 328263, 328933, 329125, 329144, 329432, 331285, 331638, 332102, 332103, 332888, 333176, 334085, 335093, 335863, 336485, 337254, 337335, 337431, 341030, 341031, 341463, 341605, 343189, 343623, 344935, 345782, 346502, 346503, 346504, 350312, 352135, 352983, 353605, 353606, 354056, 355453, 356293, 356504, 358015, 358309, 358934, 360055, 360183, 361275, 361285, 361322, 362341, 362534, 363207, 365269, 365384, 366005, 366535, 369061, 369062, 369063, 369127, 370165, 372711, 373143, 373784, 374630, 374888, 376453, 376742, 376743, 376744, 377095, 377896, 379255, 379670, 379862, 380344, 381592, 381702, 382854, 383872, 384391, 386726, 386965, 386966, 387302, 387703, 390470, 390533, 393589, 393653, 394454, 395462, 395704, 396902, 397352, 398408, 399368, 399655, 399656, 400165, 400166, 400375, 400693, 400694, 401270, 401653, 402294, 402295, 403526, 404391, 404392, 406135, 406136, 407605, 411062, 412615, 413176, 414421, 417445, 417446, 417608, 418135, 420005, 420006, 422885, 422886, 423031, 424712, 425576, 426584, 427015, 427352, 427494, 428053, 428392, 430645, 431509, 431895, 432085, 432086, 432392, 433064, 434552, 434584, 435016, 437671, 439016, 440869, 445062, 446295, 446296, 447365, 447366, 448903, 451333, 451733, 451784, 451910, 452215, 453895, 455365, 456952, 459734, 460742, 460805, 461511, 461512, 461671, 464214, 464582, 464583, 464871, 464872, 465031, 465032, 465544, 465589, 467030, 467031, 468902, 469864, 471367, 472070, 472853, 475736, 475976, 476377, 479845, 479846, 480134, 480664, 481061, 482693, 482744, 483941, 486229, 486487, 486962, 487191, 487192, 490375, 490855, 493382, 493383, 494744, 494934, 495590, 496792, 500312, 501845, 501846, 502183, 506245, 506821, 506905, 507125, 507782, 507783, 507944, 508712, 515192, 517304, 517431, 517432, 519366, 519590, 520087, 520088, 520807, 521126, 521461, 525064, 525845, 525846, 528853, 528902, 530168, 530870, 530887, 531445, 531446, 532741, 532742, 532983, 533703, 533767, 535064, 536167, 536583, 538374, 538453, 539270, 539911, 539912, 541045, 542792, 543062, 543063, 545912, 547192, 548536, 548776, 549590, 549992, 551192, 552390, 554741, 554742, 555032, 555302, 556743, 556869, 558086, 558229, 558230, 559013, 559445, 559688, 560791, 560792, 562328, 564008, 564053, 565014, 567302, 569864, 570053, 570533, 571621, 571863, 572214, 572215, 572405, 572744, 573365, 574743, 574885, 574886, 576895, 579062, 580935, 580982, 581509, 583286, 583383, 585494, 586885, 586952, 587462, 587864, 588485, 588728, 589208, 589592, 589765, 590935, 592376, 594344, 596071, 596245, 596533, 597736, 598087, 600294, 604262, 605432, 606343, 607526, 610310, 610311, 610312, 610904, 611384, 613192, 614965, 615061, 615352, 616063, 616135, 616375, 617096, 617125, 617896, 619722, 619832, 621445, 624054, 627654, 627735, 628664, 628855, 628856, 631432, 631832, 632694, 632695, 633110, 634232, 634262, 636710, 638407, 638408, 639734, 639991, 639992, 640855, 640885, 640886, 641765, 642295, 644293, 645031, 645205, 646232, 646789, 647381, 647382, 647383, 647384, 648326, 648344, 649623, 649624, 649830, 649856, 650245, 650741, 652885, 654182, 654952, 656312, 656934, 657542, 657895, 658232, 658711, 659701, 662390, 662485, 664183, 664184, 665093, 665816, 668211, 668632, 669736, 672536, 676165, 676262, 676711, 678486, 679735, 679736, 680726, 680869, 682070, 684805, 685864, 688134, 689143, 689432, 690805, 693031, 693032, 693542, 693685, 694504, 694741, 694742, 697206, 700134, 700135, 701463, 701544, 701911, 701912, 702182, 702183, 703335, 705416, 706069, 707032, 707286, 707287, 707288, 709303, 710454, 711752, 712405, 712453, 713845, 714632, 716005, 716006, 718232, 718471, 720085, 720245, 720246, 722055, 723991, 723992, 725845, 726565, 726566, 727094, 729542, 729543, 729544, 730645, 731461, 731462, 731703, 731941, 733158, 734696, 734948, 736070, 738902, 740310, 741254, 741783, 742552, 742567, 742855, 744005, 744709, 744806, 751142, 751303, 754743, 755191, 755192, 755462, 756343, 756581, 757207, 757544, 757670, 760504, 760711, 760712, 760855, 762086, 762296, 763688, 763734, 763735, 763862, 765032, 765894, 766263, 766335, 766982, 767431, 767893, 768776, 769189, 769862, 769863, 769864, 770693, 771445, 771446, 772213, 772214, 772711, 776936, 777254, 777271, 777415, 778294, 778981, 780854, 781832, 782312, 782742, 783416, 783894, 783895, 786565, 786566, 787735, 787736, 788504, 788583, 789832, 789895, 792326, 793192, 796405, 796502, 796503, 798470, 799255, 802086, 802855, 802856, 802904, 803605, 805862, 807079, 807445, 809301, 809302, 809462, 810902, 810903, 812215, 812821, 813942, 813943, 817592, 820262, 820263, 820310, 820471, 820856, 822151, 823285, 823432, 823862, 824629, 824744, 825735, 828872, 829445, 829622, 832502, 832503, 833192, 836389, 836390, 836407, 836632, 837543, 838405, 838615, 839030, 839991, 839992, 841143, 841592, 842005, 842006, 842101, 842373, 844133, 844231, 844232, 845221, 845382, 845383, 845815, 846744, 846902, 846966, 846967, 847254, 847255, 848246, 848582, 848583, 848695, 848966, 849493, 849494, 850088, 852296, 853095, 853096, 854018, 855320, 855703, 857606, 857814, 857815, 858470, 862616, 863528, 864184, 865013, 865526, 866341, 866342, 868567, 868614, 869096, 871381, 871382, 875095, 875462, 876152, 876295, 876296, 876631, 877928, 880119, 880662, 882183, 883351, 883352, 883832, 884504, 884821, 885512, 887576, 889189, 889816, 890534, 891271, 891415, 891776, 893126, 893512, 894952, 896485, 898328, 898374, 898645, 898885, 901503, 903351, 903512, 904405, 904712, 905511, 905512, 905815, 906967, 907464, 908631, 908632, 909176, 911270, 911912, 915781, 915896, 916373, 917527, 919207, 923989, 927624, 928232, 930181, 930390, 934311, 934312, 937025, 938203, 939416, 939894, 940312, 941432, 942485, 943285, 943815, 944407, 944485, 945783, 946712, 947703, 947767, 948965, 950005, 950342, 950343, 951205, 952039, 952552, 954392, 956552, 957414, 957512, 958645, 958791, 958792, 959365, 959846, 960967, 960968, 961301, 961494, 962965, 963445, 964310, 969832, 970616, 970808, 980184, 981205, 984135, 984295, 984344, 986455, 987032, 988374, 988375, 988952, 989095, 989894, 990661, 990662, 991045, 991622, 991910, 992693, 992870, 993542, 995815, 995942, 996229, 998389, 999649

Naturally I was interested in finding the limit of these runs from one to one million. What about runs of five numbers? Well the number shrinks drastically to just 179 (permalink).

11605, 12855, 13782, 19142, 21494, 28374, 28375, 40311, 42805, 50582, 55254, 60231, 60663, 79094, 87655, 90181, 90182, 95845, 99655, 103621, 109765, 115591, 120727, 121045, 122151, 122871, 142454, 142806, 152630, 157493, 157494, 171893, 171894, 171895, 174054, 175143, 178086, 180901, 180965, 180966, 180967, 183205, 184327, 186951, 188293, 191943, 199111, 204323, 210133, 210134, 212005, 225463, 235495, 236245, 246631, 251751, 253014, 263765, 295014, 298694, 298695, 306631, 307254, 309415, 309655, 312151, 326791, 328262, 332102, 341030, 346502, 346503, 353605, 369061, 369062, 376742, 376743, 386965, 399655, 400165, 400693, 402294, 404391, 406135, 417445, 420005, 422885, 432085, 446295, 447365, 461511, 464582, 464871, 465031, 467030, 479845, 487191, 493382, 501845, 507782, 517431, 520087, 525845, 531445, 532741, 539911, 543062, 554741, 558229, 560791, 572214, 574885, 610310, 610311, 628855, 632694, 638407, 639991, 640885, 647381, 647382, 647383, 649623, 664183, 679735, 693031, 694741, 700134, 701911, 702182, 707286, 707287, 716005, 720245, 723991, 726565, 729542, 729543, 731461, 755191, 760711, 763734, 769862, 769863, 771445, 772213, 783894, 786565, 787735, 796502, 802855, 809301, 810902, 813942, 820262, 832502, 836389, 839991, 842005, 844231, 845382, 846966, 847254, 848582, 849493, 853095, 857814, 866341, 871381, 876295, 883351, 905511, 908631, 934311, 950342, 958791, 960967, 988374, 990661

What about runs of six numbers? There are just 18 (permalink).

28374, 90181, 157493, 171893, 171894, 180965, 180966, 210133, 298694, 346502, 369061, 376742, 610310, 647381, 647382, 707286, 729542, 769862

What about runs of seven numbers? There are a mere three (permalink) and there are no runs of eight numbers in the range up to one million.

171893, 180965, 647381

Let's look at the factorisation of these numbers. We find all three have eight divisors and most are sphenic numbers except for a single number that is divisible by eight.

171893 = 19 x 83 x 109 and has 8 divisors
171894 = 2 x 3 x 28649 and has 8 divisors
171895 = 5 x 31 x 1109 and has 8 divisors
171896 = 2^3 x 21487 and has 8 divisors
171897 = 3 x 11 x 5209 and has 8 divisors
171898 = 2 x 61 x 1409 and has 8 divisors
171899 = 7 x 13 x 1889 and has 8 divisors

180965 = 5 x 17 x 2129 and has 8 divisors
180966 = 2 x 3 x 30161 and has 8 divisors
180967 = 37 x 67 x 73 and has 8 divisors
180968 = 2^3 x 22621 and has 8 divisors
180969 = 3 x 179 x 337 and has 8 divisors
180970 = 2 x 5 x 18097 and has 8 divisors
180971 = 7 x 103 x 251 and has 8 divisors

647381 = 7 x 23 x 4021 and has 8 divisors
647382 = 2 x 3 x 107897 and has 8 divisors
647383 = 11 x 229 x 257 and has 8 divisors
647384 = 2^3 x 80923 and has 8 divisors
647385 = 3 x 5 x 43159 and has 8 divisors
647386 = 2 x 89 x 3637 and has 8 divisors
647387 = 13 x 19 x 2621 and has 8 divisors

The appearance of a number with eight as a divisor is not surprising given that, out of eight consecutive numbers, one must be divisible by eight. In fact every fourth number must be divisible by 4 and it appears that in all our runs the number immediately before the first number and after the last number is divisible by 4. For example, consider the case of 647381:

647380 = 2^2 * 5 * 32369 and has 12 divisors
647381 = 7 * 23 * 4021 and has 8 divisors
647382 = 2 * 3 * 107897 and has 8 divisors
647383 = 11 * 229 * 257 and has 8 divisors
647384 = 2^3 * 80923 and has 8 divisors
647385 = 3 * 5 * 43159 and has 8 divisors
647386 = 2 * 89 * 3637 and has 8 divisors
647387 = 13 * 19 * 2621 and has 8 divisors
647388 = 2^2 * 3^2 * 7^2 * 367 and has 54 divisors

By extension, one can investigate other sorts of runs. For example, runs of numbers with the same number of prime factors.  Investigation reveals that 526095 is the only number in the range up to one million that starts off a run of 14 numbers, all with three prime factors (permalink).

526095 = 3^5 x 5 x 433 has prime factors [3, 5, 433]
526096 = 2^4 x 131 x 251 has prime factors [2, 131, 251]
526097 = 11 x 13^2 x 283 has prime factors [11, 13, 283]
526098 = 2 x 3 x 87683 has prime factors [2, 3, 87683]
526099 = 7 x 17 x 4421 has prime factors [7, 17, 4421]
526100 = 2^2 x 5^2 x 5261 has prime factors [2, 5, 5261]
526101 = 3 x 31 x 5657 has prime factors [3, 31, 5657]
526102 = 2 x 23 x 11437 has prime factors [2, 23, 11437]
526103 = 37 x 59 x 241 has prime factors [37, 59, 241]
526104 = 2^3 x 3^2 x 7307 has prime factors [2, 3, 7307]
526105 = 5 x 43 x 2447 has prime factors [5, 43, 2447]
526106 = 2 x 7 x 37579 has prime factors [2, 7, 37579]
526107 = 3 x 157 x 1117 has prime factors [3, 157, 1117]
526108 = 2^2 x 11^2 x 1087 has prime factors [2, 11, 1087]

Tuesday, 8 November 2022

Reversible Sphenic Numbers

There is the reversible prime, known as an emirp. There is the reversible semiprime, known as an emirpimes, and then there is the reversible sphenic number, known as an cinehps. This is a rather ugly term so I'll just use the term reversible sphenic number. An example of an emirp is 17 whose reversal, 71, is also prime. An example of an emirpimes is 26 = 2 x 13 whose reversal, 62 = 2 x 31, is also a semiprime. The first example of a cinehps is 165 = 3 x 5 x 11 whose reversal, 561 = 3 x 11 x 17, is also a sphenic number.

These numbers form OEIS A270175:


 A270175



Cinehps numbers: sphenic numbers whose reversal is a different sphenic numbe
r.

Note that palindromic sphenic numbers are excluded. The initial members of the sequence are:

165, 246, 285, 286, 366, 418, 435, 438, 498, 534, 561, 582, 609, 642, 663, 682, 759, 814, 834, 894, 906, 957, 1002, 1023, 1034, 1066, 1095, 1113, 1131, 1185, 1209, 1239, 1245, 1265, 1311, 1342, 1353, 1374, 1398, 1419, 1443, 1446, 1479, 1515, 1526, 1542, 1545, ...

Up to the one million mark, these numbers total 5.28% of the range. One of the concepts associated with a sphenic number is that of the sphenic brick. Let's consider a sphenic number \(n\) whose factors are \(a,b,c\). The sphenic brick is the three dimensional cuboid with volume of \(n\) cubic units and linear dimensions of \(a,b\) and \(c\) units.

Such a brick has an associated surface area and a thought occurred to me. Are there any reversible sphenic number pairs that each have the same surface area? A little investigation revealed that there are. They are rare birds indeed however, and there are only eight ( in four pairs) in the range up to three million (366 and 663, 3245 and 5423, 3685 and 5863, 921239 and 932129). Here are the details and here is the permalink to the calculation. Surface areas are shown in bold red.

366  = 2 x 3 x 61 --> 622 and 663 = 3 x 13 x 17 --> 622
3245 = 5 x 11 x 59 --> 1998 and 5423 = 11 x 17 x 29 --> 1998
3685 = 5 x 11 x 67 --> 2254 and 5863 = 11 x 13 x 41 --> 2254
921239 = 11 x 89 x 941 --> 190158 and 932129 = 11 x 101 x 839 --> 190158

None of the sphenic bricks associated with these numbers look like bricks because they are all very elongated but that's the term that is used for these shapes. Figure 1 shows that the 11 x 89 x 941 looks more like a plank than a brick.


Figure 1

There may well be more beyond the three million mark but SageMathCell timed out above that. Anyway, fascinating that such numbers exist with the first of them being 366, the number of days in a leap year. It can be noted that 366 is the only even number. Placed in sequence on the number line we have:

366, 663, 3245, 3685, 5423, 5863, 921239, 932129

This sequence of terms could be described thus:

Non-palindromic sphenic numbers which, when reversed, are also sphenic numbers with the members of both pairs having identical sphenic brick surface areas. 

Not surprisingly this sequence does not appear in the OEIS, nor will it, as I have ceased to contribute.

ADDENDUM:

The above idea can be applied to semiprimes as well. In this case we will be working with two dimensional rectangles. The two factors of the semiprime form the length and width of the associated rectangle. In the range up to one million, reversible semiprimes comprise 6.06% of the total range but there are only 26 reversible semiprimes with the property that their associated areas are equal. See permalink for calculation.

The pairs (up to one million) are:

14269 = 19 x 751 --> 1540 and 96241 = 157 x 613 --> 1540
15167 = 29 x 523 --> 1104 and 76151 = 271 x 281 --> 1104
16237 = 13 x 1249 --> 2524 and 73261 = 61 x 1201 --> 2524
18449 = 19 x 971 --> 1980 and 94481 = 107 x 883 --> 1980
18977 = 7 x 2711 --> 5436 and 77981 = 29 x 2689 --> 5436
36679 = 43 x 853 --> 1792 and 97663 = 127 x 769 --> 1792
140941 = 97 x 1453 --> 3100 and 149041 = 103 x 1447 --> 3100
150251 = 347 x* 433 --> 1560 and 152051 = 383 x 397 --> 1560
196891 = 401 x 491 --> 1784 and 198691 = 431 x 461 --> 1784
302363 = 211 x 1433 --> 3288 and 363203 = 263 x 1381 --> 3288
308459 = 173 x 1783 --> 3912 and 954803 = 937 x 1019 --> 3912
319853 = 317 x 1009 --> 2652 and 358913 = 379 x 947 --> 2652
958099 = 761 x 1259 --> 4040 and 990859 = 839 x 1181 --> 4040

It can be noted that all these reversible semiprimes are odd.

If we are even more adventurous we can consider numbers with four distinct factors as being associated with 4-dimensional hypercuboids. When unfolded into 3-dimensions, the eight cuboids are the equivalent of the surface area of our sphenic bricks. In the range up to three million, about 1.48% of numbers are reversible four factor numbers with the first one being 1518 = 2 x 3 x 11 x 23 and 8151 = 3 x 11 x 13 x 19. However, no number pairs emerge with identical volumes of unfolded cuboids. Figure 1 shows an unfolded hypercube and an unfolded hypercuboid will look similar but will have four pairs of cuboids each with different volumes, instead of consisting of eight identical cubes. Permalink (which may need double checking).


Figure 1

Monday, 7 November 2022

Magnanimous Primes

On December 27th 2020, almost two years ago, I created a post titled Magnanimous Numbers which are defined as follows:

A magnanimous number is a number (which we assume to be of at least 2 digits) such that the sum obtained inserting a "+" among its digit in any position gives a prime.

Such numbers are quite rare. At the time of that post, I had just turned 26201 days old and this number is magnanimous. Since then my diurnal age has corresponded to only one other such number: 26285. That is, until today, when I turned 26881 days old, a number that is also magnanimous. Checking we find that:$$ \begin{align} 2+6881&= 6883 \text{ which is prime}\\26+881&=907 \text{ which is prime}\\268+81&=349 \text{ which is prime}\\2688+1&=2689  \text{ which is prime}\end{align}$$What differentiates 26881 from these other numbers is that it is prime itself and is thus a member of a special class of numbers known as magnanimous primes. Though magnanimous numbers are rare, magnanimous primes are naturally even rarer. Such primes belong to OEIS  A089392 with the single digit primes (2, 3, 5 and 7) being included for completeness.


 A089392

Magnanimous primes: primes with the property that inserting a "+" in any place between two digits yields a sum which is prime.

 Up to one million, there are only 71 such primes (see permalink). They are:

2, 3, 5, 7, 11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 101, 227, 229, 281, 401, 443, 449, 467, 601, 607, 647, 661, 683, 809, 821, 863, 881, 2221, 2267, 2281, 2447, 4001, 4027, 4229, 4463, 4643, 6007, 6067, 6803, 8009, 8221, 8821, 20261, 24407, 26881, 28429, 40427, 40483, 42209, 60443, 68683, 80849, 220021, 224027, 228601, 282809, 282881, 282889, 404249, 408049, 464447, 600881, 602081, 626261, 800483, 806483, 864883

I'll see only one more (28429) during my lifetime. This site has a useful table that shows the number of magnanimous primes and their range for number of digits ranging from 2 to 9. It is reproduced in Figure 1.

Figure 1: source

It is most likely that there are only a finite number of magnanimous primes and it could well be that 608,844,043 is the largest.