Showing posts with label triplets. Show all posts
Showing posts with label triplets. Show all posts

Thursday, 9 July 2026

More On The RDIV Algorithm

Under the RDIV or Recurring Digital Invariant Variant (a weird name I know) Algorithm, all numbers that are not narcissistic will enter a loop or terminate in a narcissistic number. I was interested in the proportion of numbers that terminate in a narcissistic number and so I had Gemini create an algorithm (permalink) to determine this. In the range up to 40000, there are 12224 such numbers which account for 30.56% of the range. These include the few numbers that are narcissistic themselves namely 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,153, 370, 371, 407, 1634, 8208 and 9474 within the range. 

Here is a fuller list of narcissistic numbers (OEIS A005188):

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407, 1634, 8208, 9474, 54748, 92727, 93084, 548834, 1741725, 4210818, 9800817, 9926315, 24678050, 24678051, 88593477, 146511208, 472335975, 534494836, 912985153, 4679307774, 32164049650, 32164049651, 40028394225, 42678290603

While 12224 numbers are far too numerous to list here, we can thin the numbers by considering only triplets - meaning groups of three consecutive numbers that all lead to narcissistic numbers. Take for example, the numbers 28220, 28221 and 28222. Let's look at  their trajectories under the RDIV algorithm (permalink for generation). It will be seen that all three terminate in narcissistic numbers.

==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 28220
==================================================
Full Trajectory Visited:
28220, 32864, 41843, 35060, 11144, 2051, 642, 288, 
1032, 98, 145, 190, 730, 370
Loop Entry Point: 370 (encountered at step 14) Pre-period Length: 13 step(s) before entering cycle Cycle Length: 1 distinct number(s) in the loop Canonical Cycle: 370

================================================== RDIV TRAJECTORY ANALYSIS FOR INPUT: 28221 ================================================== Full Trajectory Visited: 28221, 32865, 43944, 62364, 16851, 43671, 25851,
39051, 62418, 41601, 8802, 8208 Loop Entry Point: 8208 (encountered at step 12) Pre-period Length: 11 step(s) before entering cycle Cycle Length: 1 distinct number(s) in the loop Canonical Cycle: 8208 ==================================================

==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 28222
==================================================
Full Trajectory Visited:
28222, 32896, 99868, 191410, 535540, 51700, 19933, 118585,
555540, 66596, 85502, 39050, 62417, 25640, 11957, 78983,
141635, 67108, 57352, 23332, 793, 1099, 13123, 520, 133,
55, 50, 25, 29, 85, 89, 145, 190, 730, 370
Loop Entry Point: 370 (encountered at step 35) Pre-period Length: 34 step(s) before entering cycle Cycle Length: 1 distinct number(s) in the loop Canonical Cycle: 370 ==================================================

In the range up to 40000 there are 1786 such triplets and if we restrict the range to those above 28000, there are only 220 triplets. The central members of each triplet are listed below:

28134, 28221, 28314, 28365, 28563, 28635, 28653, 29121, 29211, 29278, 29728, 29729, 29792, 29972, 30006, 30051, 30055, 30060, 30061, 30151, 30160, 30221, 30222, 30223, 30224, 30233, 30234, 30242, 30249, 30250, 30251, 30252, 30280, 30323, 30324, 30343, 30422, 30433, 30501, 30505, 30510, 30511, 30520, 30521, 30522, 30561, 30601, 30610, 30651, 30820, 31051, 31060, 31111, 31112, 31113, 31114, 31115, 31132, 31133, 31142, 31143, 31284, 31312, 31313, 31412, 31413, 31474, 31475, 31501, 31510, 31744, 31745, 31824, 31839, 32021, 32022, 32023, 32024, 32033, 32034, 32042, 32049, 32050, 32051, 32052, 32080, 32184, 32200, 32201, 32202, 32203, 32204, 32221, 32246, 32254, 32303, 32304, 32402, 32409, 32410, 32426, 32453, 32501, 32502, 32519, 32524, 32529, 32543, 32649, 32685, 32800, 32814, 32865, 33023, 33024, 33043, 33112, 33113, 33199, 33203, 33204, 33310, 33332, 33403, 33556, 33564, 33573, 33574, 33654, 33753, 33754, 34022, 34033, 34112, 34113, 34174, 34175, 34202, 34209, 34210, 34226, 34253, 34303, 34470, 34482, 34523, 34629, 34714, 34715, 34809, 34842, 35001, 35005, 35010, 35011, 35020, 35021, 35022, 35061, 35101, 35110, 35201, 35202, 35219, 35224, 35229, 35243, 35356, 35364, 35373, 35374, 35423, 35500, 35536, 35557, 35558, 35564, 35565, 35601, 35634, 35654, 35655, 35733, 35734, 36001, 36010, 36051, 36249, 36285, 36354, 36429, 36501, 36534, 36554, 36555, 36740, 36825, 37144, 37145, 37353, 37354, 37414, 37415, 37533, 37534, 37640, 37898, 37988, 38020, 38124, 38139, 38214, 38265, 38409, 38442, 38625, 38798, 38978, 39788, 39878

What if we look for quadruplets of such numbers, that is four consecutive numbers such that each of them leads to a narcissistic number under the RDIV algorithm. There are 843 such quadruplets. Let's consider 29727, 29728, 29729 and 29730 (permalink for generation):

==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 29727
==================================================
Full Trajectory Visited:
29727, 92727

Loop Entry Point:   92727 (encountered at step 2)
Pre-period Length:  1 step(s) before entering cycle
Cycle Length:       1 distinct number(s) in the loop
Canonical Cycle:    92727
==================================================

==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 29728
==================================================
Full Trajectory Visited:
29728, 108688, 833089, 1057187, 3822365, 2459843, 
6993329, 14633345, 2220997, 10389865, 78677956,
80868197, 100822787, 349143695, 787435454, 219637307,
478245278, 351621107, 52404626, 3881441, 4229261,
5079674, 6804500, 2471597, 6524693, 5439665, 5517662,
1539794, 10486178, 41064387, 24359267, 50954372,
49665125, 47252996, 93994532, 129609702, 825273306,
186642546, 166928742, 582410385, 272624046, 61034823,
18535747, 29160166, 48085827, 56552866, 22988195,
120039012, 387441198, 696753525, 453809058, 660044022,
20680704, 24287425, 23064482, 18594977, 114856422,
146773863, 235381845, 272643729, 478488762, 493962894,
1307101374, 566117175, 104768859, 708502518, 312695826,
543767442, 93544662, 46934467, 52373923, 49222342,
43185378, 39788517, 88527942, 82822627, 40999873,
151754277, 125229729, 817149759, 991981191, 1683899688,
11389527500, 42046156391, 32164049651 Loop Entry Point: 32164049651 (encountered at step 85) Pre-period Length: 84 step(s) before entering cycle Cycle Length: 1 distinct number(s) in the loop Canonical Cycle: 32164049651 ==================================================

==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 29729
==================================================
Full Trajectory Visited:
29729, 134969, 1114364, 314894, 802507, 395482, 814099, 
1329123, 4787601, 4040559, 4971987, 13326561, 3763237,
1933711, 5610889, 9335335, 4947967, 11525728, 23323781,
22562213, 2077827, 4568037, 3297327, 6434685, 2770104,
1663599, 10206123, 1686691, 7719931, 11215213, 397702,
767532, 298372, 912091, 1062948, 7176570, 2828691,
9257466, 6261021, 560130, 63011, 8021, 4113, 339,
783, 882, 1032, 98, 145, 190, 730, 370 Loop Entry Point: 370 (encountered at step 52) Pre-period Length: 51 step(s) before entering cycle Cycle Length: 1 distinct number(s) in the loop Canonical Cycle: 370 ==================================================
==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 29730
==================================================
Full Trajectory Visited:
29730, 76131, 24828, 66624, 24384, 35091, 62418, 41601, 
8802, 8208 Loop Entry Point: 8208 (encountered at step 10) Pre-period Length: 9 step(s) before entering cycle Cycle Length: 1 distinct number(s) in the loop Canonical Cycle: 8208 ==================================================

Because there are four consecutive numbers, only the first and smallest will be listed and so in this case the number would be 29727. In the range between 28000 and 40000, here are the 60 initial or smallest members of each quadruplet:

29727, 30059, 30220, 30221, 30222, 30232, 30248, 30249, 30250, 30322, 30509, 30519, 30520, 31110, 31111, 31112, 31113, 31131, 31141, 31311, 31411, 31473, 31743, 32020, 32021, 32022, 32032, 32048, 32049, 32050, 32199, 32200, 32201, 32202, 32302, 32408, 32500, 33022, 33111, 33202, 33572, 33752, 34111, 34173, 34208, 34713, 35009, 35019, 35020, 35200, 35372, 35556, 35563, 35653, 35732, 36553, 37143, 37352, 37413, 37532

As for quintuplets, there are 451 of them in the range up to 40000. However, above 28000 there are only 16 and the initial or smallest members of each are:

30220, 30221, 30248, 30249, 30519, 31110, 31111, 31112, 32020, 32021, 32048, 32049, 32199, 32200, 32201, 35019

There are eight sextuplets: 30220, 30248, 31110, 31111, 32020, 32048, 32199, 32200.

There are two septuplets: 31110 and 32199 and no octuplets within the range.

Tuesday, 24 March 2026

Digit Manipulation


Video created by NotebookLM based on blog content

DIGITS TO SQUARES

Yesterday I turned 28113 days old and this number is a member of OEIS A048383: numbers \(k\) such that replacing each nonzero digit \(d\) with the \(d\)-th prime (replacing each 0 digit with a 1) yields a square. So this means that:$$28113 \rightarrow 319225 = 5^2 \times 113^2$$The members of this sequence are few and far between and in the range up to 40000 only the following numbers satisfy (permalink):$$ \begin{align} 0 &\rightarrow 1 = 1\\13 &\rightarrow 25 = 5^2\\113 &\rightarrow 225 = 3^2 \times 5^2\\2410 &\rightarrow 3721 = 61^2\\4113 &\rightarrow 7225 = 5^2 \times 17^2\\6113 &\rightarrow 13225 = 5^2 \times 23^2\\8210 &\rightarrow 19321 = 139^2\\14113 &\rightarrow 27225 = 3^2 \times 5^2 \times 11^2\\23410 &\rightarrow 35721 = 3^6 \times 7^2\\28113 &\rightarrow 319225 = 5^2 \times 113^2\\33113 &\rightarrow 55225 = 5^2 \times 47^2\\34010 &\rightarrow 57121 = 239^2\\35113 &\rightarrow 511225 = 5^2 \times 11^2 \times 13^2\\\end{align}$$DIGITS TO PRIMES

A variation on this theme is OEIS A048381:


A048381: numbers \(k\) such that replacing each nonzero digit \(d\) with the \(d\)-th prime (replacing each 0 digit with a 1) yields a prime.

Members of this sequence are far more numerous with 5629 in the range up to 40000. An example is 28112 since:$$28112 \rightarrow 319223 \text{ which is prime} $$Some upcoming members are:

28124, 28146, 28152, 28155, 28202, 28210, 28214, 28216, 28226, 28228, 28230, 28234, 28235, 28236, 28247, 28265, 28270, 28277, 28289, 28294, 28295, 28298, 28300, 28317, 28319, 28328, 28329, 28344, 28359, 28360, 28368, 28388, 28392, 28397, 28414, 28418, 28422, 28429, 28434, 28449, 28458, 28464, 28470, 28474, 28485, 28490, 28498, 28502, 28504, 28515, 28524, 28525, 28529, 28546, 28562, 28575, 28592, 28599, 28606, 28612, 28614, 28622, 28630, 28652, 28658, 28665, 28667, 28674, 28684, 28686, 28706, 28717, 28724, 28744, 28752, 28772, 28786, 28807, 28810, 28814, 28825, 28827, 28838, 28854, 28868, 28870, 28876, 28886, 28888, 28890, 28928, 28929, 28932, 28948, 28955, 28960, 28966, 28979, 28984, 28988, 28995, 28997

One way to thin the numbers when there are so many in a given range is to require that the numbers come in pairs that are consecutive integers. If this requirement is imposed then the 5629 reduces to 580. Imposing the restriction that the numbers are triplets that are consecutive integers reduces the 580 further to a manageable 103:

1, 2, 3, 4, 5, 6, 7, 24, 25, 144, 166, 167, 414, 474, 506, 674, 897, 898, 1026, 1027, 1176, 1177, 1398, 1516, 1824, 2035, 2074, 2094, 2146, 2544, 3316, 4044, 5247, 5248, 5286, 5514, 6044, 6484, 7116, 7117, 7118, 7264, 7918, 8008, 8127, 8444, 8665, 10016, 11046, 11047, 11404, 13068, 13445, 14224, 14584, 15886, 16055, 16346, 16347, 16505, 16945, 18306, 18497, 19276, 19465, 20044, 20124, 21797, 21798, 22167, 22416, 22417, 22586, 22694, 22767, 23336, 23774, 24726, 24727, 24845, 25934, 26608, 26844, 26885, 28234, 29376, 29377, 29714, 29715, 29917, 30145, 30705, 32244, 32248, 33807, 35405, 35647, 36018, 36635, 37888, 38097, 39067, 39527

Let's take 28234 as an example where:$$ \begin{align} 28234 &\rightarrow 319357\\28235 &\rightarrow 3193511\\28236 &\rightarrow 3193513 \end{align}$$There is of course an initial run of seven numbers (1 to 7) and after that there are runs of four numbers beginning with:

24, 166, 897, 1026, 1176, 5247, 7116, 7117, 11046, 16346, 21797, 22416, 24726, 29376, 29714

Finally there is only one run of five numbers and it starts with 7116.

DIGITS TO PALINDROMES

Another variation, using this same method of digit manipulation, is to ask what non-palindromic number become palindromes. Well, in the range up to 40000, it turns out that 333 numbers satisfy this condition (permalink). The numbers from 28113 onwards are:

28086, 28586, 28686, 28786, 28802, 28886, 29029, 29069, 29129, 29199, 29212, 29229, 29329, 29429, 29529, 29569, 29612, 29669, 29769, 29869, 29912, 29999, 30053, 30553, 30653, 30753, 30853, 32063, 32193, 32563, 32663, 32763, 32863, 32993, 34073, 34573, 34673, 34773, 34873, 35003, 35503, 36203, 36603, 36903, 37403, 37703, 38803, 39213, 39613, 39913

Let's use 28086 as an example:$$28086 \rightarrow 31911913$$Clearly there are many possible variations using just this particular type of digit manipulation and in this post I've shown examples of three of them where the digits \(d\) are manipulated as follows:$$ \begin{align} d &\rightarrow \text{ prime}(d) \text{ if } d \neq 0 \\0 &\rightarrow 1 \end{align} $$However, other manipulations are limited only by your imagination. An example of different type of manipulation would be:$$ d \rightarrow d^{ \, \small{2}}$$We can ask how many non-palindromic numbers become palindromes when their digits are manipulated in this manner (squared). In the range up to 40000, the answer is that there are 96 suitable numbers and they are (permalink):

19, 28, 37, 41, 72, 199, 288, 327, 377, 441, 461, 732, 772, 1191, 1281, 1371, 1411, 1721, 1919, 1999, 2192, 2282, 2372, 2412, 2722, 2828, 2888, 3193, 3207, 3217, 3227, 3237, 3283, 3373, 3413, 3723, 3737, 3777, 4141, 4441, 4661, 7032, 7132, 7232, 7272, 7332, 7772, 11991, 12881, 13271, 13771, 14411, 14611, 17321, 17721, 19019, 19119, 19219, 19319, 19999, 21992, 22882, 23272, 23772, 24412, 24612, 27322, 27722, 28028, 28128, 28228, 28328, 28888, 31993, 32007, 32117, 32197, 32227, 32287, 32337, 32377, 32417, 32727, 32883, 33273, 33773, 34413, 34613, 37037, 37137, 37237, 37277, 37323, 37337, 37723, 37777

An example is 28028 where$$28028 \rightarrow 4640464$$

Saturday, 15 March 2025

Gapful Numbers Revisited

It was only recently (18th December 2024) that I made a post titled Gapful Numbers but today requires a second post about them because of the number associated with my diurnal age: 27740. This number marks the beginning of a run of three consecutive numbers with the properties that:

  • the number is gapful, meaning that the number formed by concatenating the first and last digits of the number, divides the numbers
  • the sum of the digits (SOD) of the number is also equal to the number formed by concatenating the first and last digits of the number
Thus we have:
  • 27740 \( \rightarrow \) 20 which divides it evenly and is equal to its SOD
  • 27741 \( \rightarrow \) 21 which divides it evenly and is equal to its SOD
  • 27742 \( \rightarrow \) 22 which divides it evenly and is equal to its SOD
In the range up to 40000, there are five groups of such triplets and they are:

  • 10094,10095 and 10096
  • 12255, 12256 and 12257
  • 12256, 12257 and 12258
  • 15134, 15135 and 15136
  • 27740, 27741 and 27742
However, as can seen there is actually a run of four consecutive numbers in the above list, namely 12255, 12256, 12257 and 12258. While such runs of four are rare, they become more frequent if we only require the numbers to be gapful and not have the SODs equal to the concatenated first and last digits of the number. In the range up to 40000, the quadruplets are then (permalink):
  • 10932, 10933, 10934 and 10935
  • 11229, 11230, 11231 and 11232
  • 12255, 12256, 12257 and 12258
  • 15408, 15409, 15410 and 15411
  • 16392, 16393, 16394 and 16395
  • 17170, 17171, 17172 and 17173

Tuesday, 11 February 2025

Primorials and the Sigma Function

I noticed that the sum of divisors (64680) of the number (27708) that represents my diurnal age today has the following factorisation:$$64680 = 2^3 \times 3 \times 5 \times 7^2 \times 11$$These prime factors, ignoring multiplicity, represent the factorisation of a primorial, in this case the primorial 2310:$$2310 = 2 \times 3 \times 5 \times 7 \times 11$$This got me wondering what other numbers in the range up to 40000 have a sum of divisors whose prime factors, again without multiplicity, form the primorial 2310. It turns out that there are 267 such numbers. They are (permalink):

1538, 2180, 2309, 2456, 2636, 2834, 3488, 3688, 3845, 4469, 4472, 4614, 4618, 4796, 4988, 5276, 6152, 6158, 6540, 6927, 7085, 7368, 7412, 7690, 7908, 7916, 8424, 8459, 8502, 8567, 8759, 8780, 8903, 8938, 9047, 9236, 9239, 9396, 9848, 9956, 10028, 10148, 10464, 10766, 11064, 11336, 11414, 11535, 11545, 11549, 11666, 11876, 11954, 12280, 12447, 12644, 13073, 13180, 13196, 13369, 13407, 13416, 13544, 13624, 13854, 13859, 14048, 14104, 14148, 14170, 14388, 14776, 14964, 14972, 15196, 15260, 15308, 15380, 15395, 15398, 15587, 15828, 16163, 16211, 16340, 16578, 16918, 17134, 17147, 17192, 17440, 17518, 17687, 17806, 17876, 17999, 18017, 18094, 18113, 18203, 18209, 18440, 18452, 18456, 18472, 18474, 18478, 19116, 19316, 19838, 19988, 19994, 20488, 20492, 20789, 21088, 21116, 21146, 21242, 21255, 21276, 22236, 22301, 22345, 22360, 22518, 22852, 23070, 23090, 23098, 23099, 23108, 23220, 23748, 23756, 23980, 24089, 24416, 24608, 24632, 24894, 24940, 25064, 25377, 25399, 25409, 25628, 25701, 25724, 25727, 25816, 26144, 26146, 26277, 26340, 26380, 26396, 26568, 26709, 26738, 26814, 26915, 27016, 27019, 27141, 27199, 27323, 27352, 27359, 27383, 27708, 27717, 27718, 27956, 28340, 28404, 28535, 28552, 28836, 28996, 29165, 29222, 29544, 29852, 29868, 29885, 30014, 30017, 30084, 30186, 30302, 30444, 30508, 30537, 30760, 30780, 30788, 30790, 30916, 30956, 31174, 31283, 31304, 31529, 31676, 31928, 31937, 32298, 32326, 32357, 32422, 32591, 32981, 33256, 33368, 33497, 33572, 33836, 33869, 33939, 34008, 34242, 34268, 34294, 34635, 34647, 34649, 34916, 34998, 35036, 35093, 35180, 35374, 35612, 35628, 35699, 35752, 35862, 35948, 35998, 36034, 36077, 36143, 36188, 36226, 36406, 36418, 36419, 36437, 36557, 36840, 36932, 36956, 37060, 37152, 37932, 38368, 38495, 38498, 38597, 38804, 39219, 39253, 39540, 39580, 39588, 39904

What caught my attention in this sequence of numbers was a pair of numbers that will be coming up for me in a little over a week. The numbers are 27717 and 27718. This got me to wondering if there were other such number pairs in the range up to 40000 and it turns out that there are. The other two are (23098, 23099) and (36418, 36419). See Table 1 for the details. 


Table 1

27718 also has the interesting property that its cototient has the same prime factors as 2310 since the totient is 13858 and thus the cototient is$$27718 - 13858 = 13860 = 2^2 \times 3^2 \times 5 \times 7 \times 11$$In the range up to 40000, the only numbers with this property are 4618, 9236, 18472, 18478, 23098, 27718 and 36956 (permalink). 

Anyway getting back on track, these pairs got me thinking about runs of three consecutive numbers and perhaps higher runs. I extended the range up to one million and in that range there are seven triplets of numbers whose sum of divisors consists form the factors of the primorial 2310. See Table 2.


Table 2

Looking at Table 2 it can be seen that there are two groups of quadruplets. See Table 3.


Table 3

Let's just double check the last quadrupets 692994, 692995, 692996 and 692997. See Table 4.


Table 4

So in terms of my diurnal age what's of interest is that the number pair 27717 and 27718 is coming up in a little over a week and its members share the interesting property discussed in this post. Let's move on to the primorial 210 = 2 x 3 x 5 x 7. In the range up to 40000, there are 1945 numbers with sums of divisors with prime factors (considered without multiplicity) that multiply together to give the primorial 210. I won't list them all but here is a permalink.

Restricting ourselves to the range up to 40000, we do get two groups of quintuplets. They are 20154 to 20158 and 29395 to 29399. 

Quadruplets are more numerous of course and Table 5 shows these.


Table 5: permalink

Groups of triplets are shown in Table 6.


Table 6: permalink

The pairs are too numerous to list here but this is a permalink.

Wednesday, 14 June 2023

Kaprekar Quintuples

I've written about Kaprekar before in posts titled Kaprekar's Routine on 16th July 2021 and Birth Year Magic on 3rd June 2020. Today, the number associated with my diurnal age (27100) brought me into contact with him again via his Kaprekar Quintuples. These are numbers \(n\) with the property that the digits of \(n^5\) taken \(d\) at a time sum to \(n\) (where \(d\) is the number of digits in \(n\)).

Let's illustrate this in the case of 27100 where we take groups of five digits beginning from the rightmost digit, leaving three digits remaining on the left:$$27100^5 = 14616603103510000000000\\ 146+16603+10351+00000+00000 = 27100 $$Let's try with another number, 7776, that has four digits instead of five. Here we take groups of four digits beginning at the rightmost digit with no digits left over:$$7776^5 = 28430288029929701376 \\2843+0288+0299+2970+1376 = 7776$$The members of the sequence are (permalink showing members up to 100,000):

1, 10, 1000, 7776, 27100, 73440, 95120, 500499, 505791, 540539, 598697, 665335, 697598, 732347, 7607610, 37944478, 46945205, 54995500, 55216205, 56607166, 58106906, 63136413, 66595563, 68167738, 68807564, 69188525, 70667477, 72197730, 73197730, 74145807

These numbers constitute OEIS A171500. These numbers can also be called order-5 Kaprekar numbers and this site shows the initial members. See Table 1.


Table 1

The same site also shows order-4 Kaprekar numbers or Kaprekar quadruples where numbers are raised to the fourth power. See Table 2.


Table 2

Order-3 and order-2 Kaprekar are also shown on this site and could be referred to as Kaprekar triplets/triples and Kaprekar couplets/pairs.

Wednesday, 22 February 2023

Modest Numbers

Modest numbers are a category of numbers that I haven't paid a great deal of attention to. They are defined by Numbers Aplenty in the following manner:

A number \(n\) is called modest if its digits can be separated into two numbers \(a\) and \(b\) such that \(n\) divided by \(b\) gives \(a\) as remainder.

The reason its came to my attention is that Julian Day Number 2459999 is approaching and it has the property of being a modest number because 9999 divides 2459999 to give 245 or to put it in another format:$$2459999 \! \! \mod 99999 \equiv 245$$I developed an algorithm in SageMath to determine all the modest numbers in a given range. Here are the modest numbers in the range up to 40,000 (permalink), constituting 2.25% of the range:

13, 19, 23, 26, 29, 39, 46, 49, 59, 69, 79, 89, 103, 109, 111, 133, 199, 203, 206, 209, 211, 218, 222, 233, 266, 299, 309, 311, 327, 333, 399, 406, 409, 411, 412, 418, 422, 433, 436, 444, 466, 499, 509, 511, 515, 533, 545, 555, 599, 609, 611, 618, 622, 627, 633, 654, 666, 699, 709, 711, 721, 733, 763, 777, 799, 809, 811, 812, 818, 822, 824, 833, 836, 844, 866, 872, 888, 899, 911, 927, 933, 981, 999, 1003, 1009, 1011, 1015, 1018, 1022, 1027, 1030, 1033, 1037, 1045, 1055, 1066, 1090, 1099, 1111, 1133, 1199, 1218, 1222, 1227, 1233, 1236, 1244, 1254, 1266, 1299, 1333, 1339, 1399, 1418, 1421, 1422, 1433, 1442, 1463, 1466, 1477, 1499, 1527, 1533, 1545, 1555, 1599, 1618, 1622, 1624, 1633, 1636, 1644, 1648, 1666, 1672, 1688, 1699, 1733, 1751, 1799, 1822, 1827, 1833, 1854, 1866, 1881, 1899, 1933, 1957, 1999, 2003, 2006, 2009, 2018, 2022, 2027, 2030, 2033, 2036, 2037, 2044, 2045, 2054, 2055, 2060, 2066, 2074, 2090, 2099, 2111, 2127, 2133, 2163, 2177, 2199, 2222, 2233, 2266, 2299, 2333, 2369, 2399, 2427, 2433, 2436, 2444, 2454, 2466, 2472, 2488, 2499, 2533, 2545, 2555, 2575, 2599, 2633, 2639, 2666, 2678, 2699, 2733, 2781, 2799, 2833, 2836, 2842, 2844, 2863, 2866, 2877, 2884, 2899, 2933, 2987, 2999, 3009, 3027, 3033, 3037, 3045, 3054, 3055, 3066, 3081, 3090, 3099, 3111, 3133, 3193, 3199, 3233, 3236, 3244, 3248, 3266, 3272, 3288, 3296, 3299, 3333, 3399, 3451, 3466, 3499, 3545, 3555, 3563, 3577, 3599, 3644, 3654, 3666, 3681, 3699, 3799, 3857, 3866, 3899, 3999, 4006, 4009, 4012, 4018, 4027, 4036, 4037, 4044, 4045, 4054, 4055, 4060, 4066, 4072, 4074, 4088, 4090, 4099, 4108, 4111, 4148, 4199, 4222, 4254, 4263, 4266, 4277, 4299, 4333, 4399, 4444, 4466, 4499, 4555, 4581, 4599, 4666, 4669, 4699, 4799, 4854, 4866, 4872, 4888, 4899, 4963, 4977, 4999, 5009, 5015, 5027, 5037, 5045, 5055, 5066, 5075, 5090, 5099, 5111, 5135, 5185, 5199, 5266, 5278, 5299, 5333, 5399, 5466, 5481, 5499, 5555, 5599, 5663, 5666, 5672, 5677, 5684, 5688, 5699, 5799, 5866, 5887, 5899, 5999, 6009, 6018, 6027, 6037, 6054, 6066, 6074, 6081, 6090, 6099, 6111, 6162, 6199, 6222, 6266, 6293, 6299, 6333, 6377, 6381, 6399, 6466, 6472, 6488, 6496, 6499, 6599, 6666, 6699, 6799, 6899, 6999, 7009, 7021, 7027, 7037, 7063, 7077, 7090, 7099, 7111, 7189, 7199, 7259, 7281, 7288, 7299, 7333, 7399, 7499, 7599, 7699, 7777, 7799, 7899, 7999, 8009, 8012, 8018, 8024, 8027, 8036, 8037, 8054, 8072, 8074, 8088, 8090, 8099, 8108, 8111, 8148, 8199, 8216, 8222, 8296, 8299, 8333, 8399, 8444, 8499, 8599, 8666, 8699, 8799, 8888, 8899, 8999, 9027, 9037, 9081, 9099, 9111, 9199, 9243, 9299, 9333, 9399, 9499, 9599, 9699, 9799, 9899, 9999, 10003, 10009, 10011, 10015, 10018, 10027, 10030, 10033, 10037, 10045, 10054, 10074, 10090, 10099, 10101, 10111, 10135, 10185, 10222, 10270, 10303, 10333, 10370, 10555, 10666, 10909, 10999, 11027, 11033, 11037, 11099, 11111, 11297, 11333, 11407, 11999, 12018, 12027, 12036, 12037, 12054, 12074, 12081, 12108, 12111, 12148, 12162, 12222, 12324, 12333, 12444, 12666, 12999, 13027, 13037, 13039, 13111, 13117, 13333, 13351, 13481, 13999, 14018, 14021, 14027, 14037, 14042, 14054, 14063, 14074, 14111, 14126, 14189, 14222, 14259, 14333, 14378, 14518, 14666, 14777, 14999, 15027, 15037, 15045, 15081, 15111, 15135, 15185, 15333, 15405, 15555, 15999, 16018, 16024, 16027, 16036, 16037, 16048, 16054, 16072, 16074, 16108, 16111, 16144, 16148, 16216, 16222, 16296, 16333, 16432, 16444, 16592, 16666, 16888, 16999, 17027, 17037, 17051, 17111, 17153, 17333, 17459, 17629, 17999, 18027, 18037, 18054, 18074, 18081, 18111, 18162, 18222, 18243, 18333, 18486, 18666, 18999, 19027, 19037, 19057, 19111, 19171, 19333, 19513, 19703, 19999, 20003, 20006, 20009, 20011, 20018, 20022, 20027, 20030, 20033, 20036, 20037, 20045, 20054, 20060, 20066, 20074, 20090, 20099, 20101, 20108, 20111, 20135, 20148, 20180, 20185, 20198, 20202, 20222, 20270, 20303, 20333, 20370, 20444, 20540, 20555, 20606, 20666, 20740, 20909, 20999, 21027, 21037, 21063, 21081, 21111, 21189, 21259, 21333, 21567, 21777, 21818, 21999, 22027, 22033, 22037, 22054, 22066, 22074, 22099, 22111, 22198, 22222, 22297, 22333, 22407, 22594, 22666, 22814, 22999, 23027, 23037, 23069, 23111, 23207, 23333, 23621, 23851, 23999, 24027, 24036, 24037, 24054, 24072, 24074, 24081, 24108, 24111, 24148, 24162, 24216, 24222, 24296, 24324, 24333, 24444, 24648, 24666, 24888, 24999, 25027, 25037, 25045, 25075, 25111, 25135, 25185, 25225, 25333, 25555, 25675, 25925, 25999, 26027, 26037, 26039, 26054, 26074, 26078, 26111, 26117, 26222, 26234, 26333, 26351, 26481, 26666, 26702, 26962, 26999, 27037, 27081, 27111, 27243, 27333, 27729, 27999, 28036, 28037, 28042, 28054, 28063, 28074, 28084, 28108, 28111, 28126, 28148, 28189, 28222, 28252, 28259, 28333, 28378, 28444, 28518, 28666, 28756, 28777, 28999, 29037, 29087, 29111, 29261, 29333, 29783, 29999, 30009, 30011, 30027, 30033, 30037, 30045, 30054, 30074, 30081, 30090, 30099, 30101, 30111, 30135, 30162, 30185, 30222, 30270, 30297, 30303, 30333, 30370, 30405, 30555, 30666, 30810, 30909, 30999, 31037, 31093, 31111, 31279, 31333, 31837, 31999, 32036, 32037, 32048, 32054, 32072, 32074, 32096, 32108, 32111, 32144, 32148, 32216, 32222, 32288, 32296, 32333, 32432, 32444, 32592, 32666, 32727, 32864, 32888, 32999, 33037, 33081, 33099, 33111, 33297, 33333, 33407, 33891, 33999, 34037, 34051, 34054, 34074, 34102, 34111, 34153, 34222, 34306, 34333, 34459, 34629, 34666, 34918, 34999, 35037, 35045, 35063, 35105, 35111, 35135, 35185, 35189, 35259, 35315, 35333, 35555, 35777, 35945, 35999, 36037, 36054, 36074, 36081, 36108, 36111, 36148, 36162, 36222, 36243, 36324, 36333, 36444, 36486, 36666, 36972, 36999, 37111, 37333, 37999, 38054, 38057, 38074, 38111, 38114, 38171, 38222, 38333, 38342, 38513, 38666, 38703, 38999, 39081, 39111, 39117, 39333, 39351, 39481, 39999

Even though the first three modest numbers are prime, the prime modest numbers occupy only 0.27% of the range (108 numbers). Consecutive modest numbers are few and far between. Here are the pairs of such numbers up to 40,000:

411 and 412
811 and 812
1421 and 1422
2036 and 2037
2044 and 2045
2054 and 2055
3054 and 3055
4036 and 4037
4044 and 4045
4054 and 4055
8036 and 8037
12036 and 12037
16036 and 16037
20036 and 20037
24036 and 24037
28036 and 28037
32036 and 32037

No triplets have been found as far as I know.

It's of interest to consider the frequency of final digits of modest numbers.

Here is the breakdown of final digits in the range up to 100000 (permalink):

There are a total of 1728 modest numbers:

0 --> 67
1 --> 218
2 --> 151
3 --> 219
4 --> 161
5 --> 128
6 --> 172
7 --> 159
8 --> 144
9 --> 309

Clearly numbers ending in the digit 9 predominate.

CONTINUED IN NEXT POST DUE TO TECHNICAL DIFFICULTIES

Tuesday, 18 October 2022

Triplets of Disjoint Twin Primes

Today, having turned 26861 days, I noticed that it formed the smaller of a pair of twin primes but more than that it had a special property that qualified it for membership of OEIS A035791:


 A035791

Start of a string of exactly 3 consecutive (but disjoint) pairs of twin primes.



The requirement that the three pairs be disjoint disqualifies prime pairs like (101, 103), (103, 107) and (107, 109) because of the 103 and 107 overlap. It turns out that such triplets of twin primes are relatively rare. The previous was 21587 and the next will be 49367! 

I managed to get SageMathCell to generate the OEIS sequence up to 100,000,000 as well as a table showing the record gaps between the first prime of the first prime pair and the last prime of the last prime pair. The table is shown in Figure 1 below in the range up to 100,000,000:

Figure 1: permalink

As can be seen, 26861 holds the equal record gap of 32 with the next member (49367) creating a new record of 44. The members of the sequence up to one million are shown below:

5, 179, 809, 3359, 4217, 6761, 9419, 9431, 18041, 21587, 26861, 49367, 62969, 62981, 67187, 72221, 72227, 80447, 82721, 91127, 97841, 98897, 103967, 109829, 122597, 154157, 178037, 203321, 208931, 225749, 227609, 236867, 243671, 251201, 266447, 285611, 289109, 295871, 317729, 330287, 342047, 358877, 375251, 392261, 392267, 397517, 402329, 405047, 420809, 422087, 440549, 444341, 452519, 489911, 495569, 495587, 524507, 524969, 560477, 563411, 565889, 570497, 595139, 622187, 629567, 632297, 636059, 640229, 641519, 651179, 663569, 663581, 670037, 677459, 686009, 690839, 704549, 746507, 753437, 758711, 768167, 773609, 773951, 777389, 795761, 797567, 830309, 831371, 842321, 854897, 873569, 875261, 875981, 907367, 909287, 909299, 909317, 946079, 983429, 994307, 997811

The full range of OEIS sequences are:
  • A035789: Start of a string of exactly 1 consecutive (but disjoint) pairs of twin primes.
  • A035790: Start of a string of exactly 2 consecutive (but disjoint) pairs of twin primes.
  • A035791: Start of a string of exactly 3 consecutive (but disjoint) pairs of twin primes.
  • A035792: Start of a string of exactly 4 consecutive (but disjoint) pairs of twin primes.
  • A035793: Start of a string of exactly 5 consecutive (but disjoint) pairs of twin primes.
  • A035794: Start of a string of exactly 6 consecutive (but disjoint) pairs of twin primes.
  • A035795: Start of a string of exactly 7 consecutive (but disjoint) pairs of twin primes.
For quadruplets and beyond, the numbers are very large except for the first few members of OEIS A035792 (quadruplets) that are below a million: 9419, 62969, 72221, 392261, 495569 and 663569. 

Monday, 31 January 2022

One Step Away

I've written about home primes before in the following posts:

I was reminded of the term again today when I was searching for properties associated with the number representing my diurnal age: 26601. This was one of those numbers that crop up from time to time that seemingly, after exhausting all my usual resources, have no interesting properties. Of course, they invariably do and it's up to me to discover them.

After some time, I hit on the idea of home primes. These are the primes formed when the factors of a composite number are concatenated to form a new number. The process is continued until a prime number is reached. For example, let's consider the number 9 that has a home prime of 311.

9 = 3 x 3 → 33 = 3 x 11 → 311 which is prime

It occurred to me that 26601 = 3 x 8867 --> 38867 is prime. In other words, it only takes one step for 26601 to get to its home prime. Some numbers, the smallest being 49, haven't been shown as yet to reach a home prime but I've written about these Home Primes post. What I was interested in here was finding all the numbers in the range up to 40,000 that reach their home primes in only one step.

I developed a SageMath algorithm (permalink) to find these numbers and it turns out that there are 6699 of them, representing about 16.7% of the total numbers in the range. These numbers form OEIS A046411


A046411



Composite numbers the concatenation of whose prime factors is a prime.



The initial members of the sequence are:
6, 12, 18, 21, 22, 28, 33, 39, 46, 51, 52, 54, 58, 63, 66, 70, 82, 84, 93, 98, 111, 115, 117, 133, 141, 142, 148, 154, 159, 162, 165, 166, 171, 172, 175, 177, 182, 187, 198, 201, 205, 207, 210, 219, 220, 226, 232, 235, 237, 245, 246, 247, 249, 253, 255, 261, 262, 264, 266, 267, 268, 274, 279, 282, 291, 292, 294, 297, 301, 310, 319, 327, 338, 350, 355, 358, 376, 384, 385, 387, 388, 391, 392, 399, 406, 408, 411, 423, 426, 427, 430, 432, 434, 435, 436, 440, 442, 459, 468, 472, 475, 476, 478, 489, 494, 498, 501, 502, 504, 505, 511, 516, 525, 531, 534, 535, 538, 543, 549, 552, 562, 565, 568, 573, 574, 583, 584, 586, 589, 595, 598, 608, 615, 620, 622, 628, 630, 632, 639, 657, 664, 679, 684, 686, 687, 694, 696, 697, 705, 721, 728, 741, 742, 752, 753, 756, 759, 763, 766, 771, 772, 775, 778, 781, 783, 786, 790, 793, 798, 799, 801, 804, 813, 816, 819, 820, 833, 835, 837, 856, 860, 871, 872, 875, 884, 885, 888, 889, 895, 901, 904, 916, 921, 924, 930, 934, 938, 939, 943, 946, 949, 963, 968, 985, 993, ...

So I had my "interesting" property now for 26601 and duly tweeted about it. See Figure 1:


Figure 1: source

I was interested as expected in runs of such numbers. How many pairs, triplets, quadruplets etc. are there in a given range. I decided to extend my range to one million and see what came up. What I found is that there are:
  • 137125 singletons representing 13.7% of the numbers in the range
    (remember it was 16.7% in the range up to 40,000): link

  • 18854 pairs of numbers representing 37708 numbers or 3.77%: link

  • 2557 triplets representing 7671 numbers or 0.767%: link

  • 358 quadruplets representing 1432 numbers or 0.143%

  • 50 quintuplets representing 250 numbers or 0.0250%

  • sextuplets representing 54 numbers or 0.00540%

  • 2 septuplets representing 14 numbers or 0.00140%

  • 1 octuplet representing 8 numbers or 0.000800%
These pairs, triplets, quadruplets, quintuplets, sextuplets, septuplets and octuplets are not necessarily stand-alone. For example, the two septuplets, beginning with 45162 and 45163, together form the octuplet 45162, 45163, 45164, 45165, 45166, 45167, 45168, 45169 (see post titled What's Special About 45162? uploaded on September 3rd 2022). I could modify the algorithm to generate stand-alone groups but I think the overview I've given is sufficient.

Thursday, 13 January 2022

Another Look At Semiprimes

 I've written about semiprimes before, specifically in the following posts:


SEMIPRIME TRIPLETS

However, as with most mathematical topics, there's always more to discover. Today I turned \(26583\) days old and one of the properties of the number \(26583\) is that it's a member of OEIS A115393:


 A115393

Numbers \(n\) such that \(n\), \(n-1\) and \(n-2\) are semiprimes. 
                      

So we find that:
  • \(26583 = 3 \times 8861\)
  • \(26582  = 2 \times 13291\)
  • \(26581 = 19 \times 1399\)
    It's not possible to have four semiprimes in a row because every fourth number must be a multiple of \(4\). We see that here because:
    • \(26584 =2^3 \times 3323\)
    • \(26580 = 2^2 \times  3 \times  5 \times 443\)
    In the range from \(1\) up to \(26583\) there are \(139\) such triplets. The sequence begins:
    35, 87, 95, 123, 143, 203, 215, 219, 303, 395, 447, 635, 699, 843, 923, 1043, 1139, 1263, 1347, 1403, 1643, 1763, 1839, 1895, 1943, 1983, 2103, 2183, 2219, 2307, 2363, 2435, 2463, 2519, 2643, 2723, 2735, 3099, 3387, 3603, 3695, 3867, 3903, 3959, 4287

    The first triplet is thus:

    • \(33=3 \times 11\)
    • \(34=2 \times 17\)
    • \(35=5 \times 7\) 

    RECORD RUNS OF NUMBERS THAT ARE NOT SEMIPRIMES

    What about record runs of numbers that are not semiprimes? It turns out that \(6252893229398\) marks the start of a record-breaking run of \(173\) consecutive integers that ends with \(6252893229570\). The second case of a run of the same length is between \(9189221611478\) and \(9189221611650\). There are no greater runs less than \(10^{13}\). Source

    These numbers and their factorisations can be viewed by following this permalink. The semiprimes before and after the first record-breaking run are:
    • \(6252893229397 = 83537 \times 74851781\)
    • \(6252893229571 = 609607 \times 10257253\)
    For the second record-breaking run, the semiprimes before and after are:
    • \(9189221611477 = 877 \times 10478017801\)
    • \(9189221611651 = 197 \times 46645794983\)
    The numbers in between, together with their factorisations, can be viewed by following this permalink.

    THE ARECIBO MESSAGE


    Figure 1: This is a demonstration of the message with
    colour added to highlight its separate parts.
    The binary transmission sent carried no colour information.

    An interesting use of semiprimes is the Arecibo message involving the use of the semiprime \(1679\). See Figure 1.
    The number \(1679\) was chosen because it is a semiprime (the product of two prime numbers), to be arranged rectangularly as \(73\) rows by \(23\) columns. The alternative arrangement, \(23\) rows by \(73\) columns, produces an unintelligible set of characters.

    SEMIPRIME COUNTING FORMULA

    A semiprime counting formula was discovered by E. Noel and G. Panos in 2005. Source: On distribution of semiprime numbers: Shamil Ishmukhametov.

    Let \( \pi_2 (n) \) denote the number of semiprimes less than or equal to \(n\).  Then$$ \pi_2 (n) = \sum_{k=1}^{\pi (\sqrt n) } [ \pi(n/p_k) - k + 1 ]$$where \( \pi(x) \) is the prime-counting function and \(p_k\) denotes the \(k\)th prime. Source: Semiprime from Wolfram MathWorld.

    This formula does return, correctly, the result that 26583 is the 6648th semiprime (permalink).

    Wednesday, 10 November 2021

    Semiprime Triples

    I track the properties of the number associated with my diurnal age using Airtable and today I noticed an interesting pattern. See Figure 1.


    Figure 1

    Referring to Figure 1, it can be seen that I'm experiencing a run of three consecutive semi-primes. I thought I'd investigate how frequent such runs were. I'm regarding a semi-prime as a number that is the product of two distinct prime numbers and thus excluding square numbers like 121. It should also be pointed at that a run of four consecutive semi-primes is not possible. OEIS A039833 uses the smallest of the semi-primes to mark such patterns:


     A039833

    Smallest of three consecutive square-free numbers \(k, k+1, k+2\) of the form \(p \times q\) where \(p\) and \(q\) are primes.


    Up to 1000, there are 13 such triplets with the first being (33, 34, 35):

    • (33, 34, 35)
    • (85, 86, 87)
    • (93, 94, 95)
    • (141, 142, 143)
    • (201, 202, 203)
    • (213, 214, 215)
    • (217, 218, 219)
    • (301, 302, 303)
    • (393, 394, 395)
    • (445, 446, 447)
    • (633, 634, 635)
    • (697, 698, 699)
    • (921, 922, 923)

    This gives a frequency of 1.3%. Tracking the frequency in powers of 10 (starting with 100) produces the following results: 
    • 2 in the first 100, a percentage of 2%
    • 13 in the first 1,000, a percentage of 1.3%
    • 71 in the first 10,000, a percentage of 0.71%
    • 379 in the first 100,000, a percentage of 0.379%
    • 2377 in the first 1,000,000, a percentage of 0.2377%

    This is shown in Figure 2 using a log scale for the horizontal axis.


    Figure 2: permalink

    These results are not surprising because as the numbers get larger, it is less likely that they'll have only two distinct prime factors. It would seem that, asymptotically, the frequency approaches zero.

    The next such triple is not far off, being (26581, 26582, 26583). It should be pointed out that all semi-prime triples must have one number with 2 as a factor and another number with 3 as a factor. These two numbers must be consecutive in either order. The third number, either the smallest or largest of the triple, will be a semi-prime that does not have 2 or 3 as a factor. Let's use this triple as an example:
    • 26581 = 19 x 1399
    • 26582 = 2 x 13291
    • 26583 = 3 x 8861
    Mention should be made of the situation where two semi-prime triples are separated by a single number (which must always be divisible by 36). The first such pair of triples is (213, 214, 215) and (217, 218, 219) where the dividing number 216 = 6 x 36. OEIS A202319 uses the middle semi-prime in the first member of the pair to mark such patterns (thus 214 is the first member):

     
     A202319

    Lesser of two semi-primes sandwiched each between semi-primes thus forming a twin semi-prime triple.


    The initial members of the sequence are:
    214, 143098, 194758, 206134, 273418, 684898, 807658, 1373938, 1391758, 1516534, 1591594, 1610998, 1774798, 1882978, 1891762, 2046454, 2051494, 2163418, 2163958, 2338054, 2359978, 2522518, 2913838, 3108202, 4221754, 4297318, 4334938, 4866118, 4988878, 5108794