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.

No comments:

Post a Comment