Showing posts with label trajectory. Show all posts
Showing posts with label trajectory. Show all posts

Tuesday, 18 August 2026

ODD - and EVEN + Improved Format

Some time ago I got Gemini to create a 197 page document that identifies attractors and vortices arising from the recursive ODD - and EVEN + algorithm. It also lists their number of captives. Today I got Gemini to summarise and reformat this information so that it is more readable using the exact same template it created for my August 15th post titled ODD + and EVEN - Improved Format. That 142 page document can be located here. Here are some excerpts:


Figure 1


Figure 2


Table 1


Table 2


Table 3

Table 4

Notice that while 8987 has the record number of captives under the ODD - and EVEN + recursive algorithm (in the range up to 40000), it has ZERO captives under the ODD + and EVEN - recursive algorithm. Conversely, while 38013 is a vortical in the mighty vortex {38013, 38012, 38006, 37995, 38028} with 564 captives under the ODD + and EVEN - recursive algorithm, it is a mere captive of the attractor 38050 under the ODD - and EVEN + recursive algorithm.

Friday, 14 August 2026

ODD + and EVEN - Trajectory Lengths

Let's revisit the ODD + and EVEN - algorithm that I first discussed in a post titled Odds and Evens from June of 2021. In that post, I looked at the trajectory lengths of numbers up to 100,000 and Figure 1 shows a graph summarising what I found.


Figure 1: permalink

I also found that in the range up to 100,000 there were 3725 numbers that are attractors, in other words the sums of their odd and even digits are equal. Of these, 301 are prime. These number belong to OEIS 
A036301:


 A036301

Numbers whose sum of even digits and sum of odd digits are equal.    

I then extended the range to 200,000 and found a number (158893) that required 91 steps before it entered a loop or, to put it another way, it was captured by a vortex. In this case, the vortex consisted of the vorticals 160028, 160013, 160012, 160006, 159995, 160033, 160034. Figure 2 shows a graph of the trajectories:


Figure 2: permalink

I noted that the
 average trajectory length has increased from 8.58 to 10.6. Back in 2021 I don't think I was using a Jupyter notebook and couldn't investigate further beyond 200,000 without SageMathCell timing out. With the Jupyter notebook, I was able to extend the search to one million and Figure 3 shows a graph of the trajectories:


Figure 3: permalink 
(will need a Jupyter notebook)

Over this range, the average trajectory length has increased to 14 and the record step length has increases to 287 compared to 91 in the range up to 200,000 and 81 in the range up to 100,000.

In that original blog post, I also looked at the proportion of numbers that were attractors compared to those numbers that were captives of attractors or that entered loops (this included vorticals and captives of vortices). I considered a range up to 100,000. These were the results (permalink): 
  • total of numbers that are captives of attractors 58977 up to 100000 or 59.0 percent
  • total of numbers that end in a loop is 37298 up to 100000 or 37.3 percent
  • total number of attractors up to 100000 is 3725 or 3.73 percent
Using my Jupyter notebook to extend the range to one million, the results were:

  • total of numbers that are captives of attractors is 511859 up to 1000000 or 51.2 percent

  • total of numbers that end in a loop is 463061 up to 1000000 or 46.3 percent
  • total number of attractors up to 1000000 is 25080 or 2.51 percent

Saturday, 11 July 2026

Revisiting the Divisors Algorithm

 Figure 1 shows the Divisors Algorithm that I developed early this year (link):

Figure 1

Applied to the number associated with my diurnal age today, 28223, we get the following trajectory:

28223, 169338, 4064112, 365770080, 1016028, 54865512, 7900633728, 20574567, 864131814, 165913308288, 192029292, 41478327072, 64009764, 11521757520, 13716378, 987579216, 237019011840, 243846720, 81932497920, 108150897254400, 17882092800, 17381394201600, 5486551200, 8466900, 914425200, 2032056, 28223

Figure 2 shows the trajectory. Note that the sequence returns to its starting point.


Figure 2

The vertical scale is logarithmic and the maximum value reached is impressive. Not every number enters a loop that returns it to its starting point. 28222 has a trajectory that enters a loop but it does not return to its starting point. The loop is reached at a value that is twice that of the starting point: 56444 = 2 x 28222. The trajectory is:

28222, 225776, 4515520, 252869120, 1580432, 63217280, 493885, 7902160, 98777, 790216, 25286912, 1820657664, 6321728, 112888, 1806208, 56444, 677328, 27093120, 211665, 3386640, 42333, 338664, 10837248, 780281856, 4063968, 56444

Figure 3 shows the trajectory:


Figure 3

Other numbers may or may not enter a loop but we have to call a stop somewhere. 28237 is an example of such a number where we call a halt after 99 steps. The trajectory is as shown in Figure 4 and it seems to be heading for the stars but who knows?


Figure 4

Once again, this algorithm is base-independent and so the trajectories will be identical regardless of the number base used. The trend of the trajectory for all numbers is generally upwards because of the primes \(p \rightarrow 2p+1\) but the situation will be different if we modify the rule for the primes as shown below. 

\(\text{For } p \text{ prime:}\)$$ \begin{align} &p \rightarrow 2p+1 \text{ if } p \! \bmod 4 \equiv 1 \\ &p \rightarrow \frac{p-1}{2} \text{ if }  p \bmod 4 \equiv 3 \end{align}$$
It would be interesting to investigate the trajectories using this modification. If no primes are encountered then the trajectories of course will be identical (as is the case with 28237 mentioned earlier). Here is a permalink to an implementation of this modification for the cases of:
  • primes \(p\) as above and composites \(n\) with factors counted \( \textbf{with} \) multiplicity. If \(f\) is the number of factors then:
    • if \( n \bmod f \equiv 0 \) then \(n \rightarrow n/f\)
    • if \( n \bmod f \not\equiv 0 \) then \(n \rightarrow n\times f\)
  • primes as above and composites with factors counted \textbf{without}\) multiplicity. If \(f\) is the number of factors then:
    • if \( n \bmod f \equiv 0 \) then \(n \rightarrow n/f\)
    • if \( n \bmod f \not\equiv 0 \) then \(n \rightarrow n\times f\)
  • primes as above and composites with divisors counted. If \(d\) is the number of divisors then:
    • if \( n \bmod d \equiv 0 \) then \(n \rightarrow n/d\)
    • if \( n \bmod d \not\equiv 0 \) then \(n \rightarrow n\times d\)
Here is the output for the number 28224:

=========================================
 Trajectory Analysis for N = 28224 
=========================================

1. Rule: Number of Factors (With Multiplicity)
   Highest Value: 2328480
   Trajectory Length: 15 steps
   Full Path: [28224, 282240, 23520, 211680, 2328480, 194040, 21560, 3080, 18480, 2310, 462, 1848, 308, 77, 154, 462]
   >>> Loop Detected: The sequence loops back to 462
--------------------------------------------------

2. Rule: Number of Factors (Without Multiplicity)
   Highest Value: 28224
   Trajectory Length: 9 steps
   Full Path: [28224, 9408, 3136, 1568, 784, 392, 196, 98, 49, 49]
   >>> Loop Detected: The sequence loops back to 49
--------------------------------------------------

3. Rule: Total Number of Divisors
   Highest Value: 28224
   Trajectory Length: 12 steps
   Full Path: [28224, 448, 32, 192, 2688, 84, 7, 3, 1, 2, 5, 11, 5]
   >>> Loop Detected: The sequence loops back to 5
--------------------------------------------------

Monday, 6 July 2026

Recurring Digital Invariant Variant (RDIV) Algorithm

Let's consider the following algorithm (formally called the Recurring Digital Invariant Variant or RDIV algorithm - see this link for an explanation of the name):

  • choose a number \(n\)
  • let \(k\) be the number of digits in \(n\)
  • raise each digit of \(n\) to the \(k\)-th power and add the results
  • call the new number \(n\) and repeat
Let's use \(n=14\) as an example:

  • \(14 \rightarrow 1^2 + 4^2 = 17\)
  • \(17 \rightarrow 1^2 + 7^2 = 50\)
  • \(50 \rightarrow 5^2 + 0^2 = 25\)
  • \(25 \rightarrow 2^2 + 5^2 = 29\)
  • \(29 \rightarrow 2^2 + 9^2 = 85\)
  • \(85 \rightarrow 8^2 + 5^2 = 89\)
  • \(89 \rightarrow 8^2 + 9^2 = 145\)
  • \(145 \rightarrow 1^3 + 4^3 + 5^3 = 190\)
  • \(190 \rightarrow 1^3 + 9^3 + 0^3 = 730\)
  • \(730 \rightarrow 7^3 + 3^3 + 0^3 = 370\)
  • \(370 \rightarrow 3^3 + 7^3 + 0^3 = 370\) 
370 is a narcissistic number as explained in my post Narcissistic, D-Powerfull and Friedman Numbers. The trajectory of any number under this algorithm will either end with a narcissistic number (as was the case with 14) or it will enter a loop (as is the case with 28218). The latter has the following trajectory (permalink):

==================================================
RDIV TRAJECTORY ANALYSIS FOR INPUT: 28218
==================================================
Full Trajectory Visited:

28218, 65601, 18678, 90120, 59082, 94974, 136953, 595181, 824837, 646826, 406272, 168529, 855931, 825565, 355739, 681798, 1220035, 80569, 102718, 379859, 1459029, 9660576, 6524445, 485466, 379273, 768261, 473170, 240124, 8321, 4194, 7074, 5058, 5346, 2258, 4753, 3363, 1539, 7268, 7809, 13058, 36137, 25070, 19964, 126899, 1371747, 2489202, 6896889, 16417266, 10869443, 61641187, 25966788, 86116067, 27580867, 47154531, 6683686, 5316235, 440689, 848433, 533938, 811397, 911965, 1125165, 436317, 169860, 886898, 1626673, 1665667, 2021413, 18829, 124618, 312962, 578955, 958109, 1340652, 376761, 329340, 537059, 681069 -> [loops back to 886898]

Loop Entry Point:   886898 (encountered at step 65)

Pre-period Length:  64 step(s) before entering cycle

Cycle Length:       14 distinct number(s) in the loop

Canonical Cycle:    18829, 124618, 312962, 578955, 958109, 1340652, 376761, 329340, 537059, 681069, 886898, 1626673, 1665667, 2021413

==================================================

Figure 1 shows a graph of its trajectory:

Figure 1: permalink

I've incorporated this algorithm into my daily number analysis.

Sunday, 8 February 2026

The Revision Revisited

In my post titled A Revision, I outlined an alternative algorithm for building a sequence based on the factors of numbers considered with multiplicity. This is the algorithm:

Suppose we take any positive integer \(n \gt 1\) and apply the following rules to it:
  • if a \(4k+1\) prime, double it and add 1: \(n \rightarrow 2n+1\)
  • if a \(4k+3\) prime, subtract 1 and divide by 2: \(n \rightarrow (n-1)/2\)
  • if composite, determine its number of factors \(f\) counted \( \textbf{with multiplicity}\)
    • if \( n \pmod f \equiv 0\) then \(n \rightarrow \dfrac{n}{f} \)
    • if \( n \pmod f \not\equiv 0 \) then \(n \rightarrow n \times f\)
Keep repeating this process until a loop is reached or call a stop after a fixed number of iterations. 

What I'm interested in looking at in this post are the record lengths of sequences generated over a range of numbers, noting as well the highest and lowest values that are reached by sequence members. Figure 1 shows the results in the range from one to one million (permalink):


Figure 1

Let's now consider the algorithm where multiplicity is ignored. This algorithm in as follows:

Suppose we take any positive integer \(n \gt 1\) and apply the following rules to it:
  • if a \(4k+1\) prime, double it and add 1: \(n \rightarrow 2n+1\)
  • if a \(4k+3\) prime, subtract 1 and divide by 2: \(n \rightarrow (n-1)/2\)
  • if composite, determine its number of factors \(f\) counted \( \textbf{without multiplicity}\)
    • if \( n \pmod f \equiv 0\) then \(n \rightarrow \dfrac{n}{f} \)
    • if \( n \pmod f \not\equiv 0 \) then \(n \rightarrow n \times f\)
Keep repeating this process until a loop is reached or call a stop after a fixed number of iterations. 

Figure 2 shows the record lengths, highs and lows for the range from one to one million (permalink).


Figure 2

It can be noted that the record lengths of sequences are shorter when multiplicity is ignored and more end in 1 rather than a loop.

Saturday, 12 July 2025

13x+1 Record Breaker

Trajectory length record breakers for the 3\(x\) + 1, 5\(x\) + 1, 7\(x\) + 1, 11\(x\) + 1, 13\(x\) + 1 and 17\(x\) + 1 Collatz mappings are a fairly exclusive set of numbers and its members from 27859 to 40000 are 27859, 28927, 30301, 30771, 32326, 32581, 34239, 35556, 35655, 35803, 37647, 38030, 39053, 39254 and 39281. Why start at 27859? Well this is the number associated with my diurnal age and the next celebration of such an event is about three years away when I reach 28927 days old. 27859 is associated with the 13\(x\) + 1 mapping where the numbers that mark the record breaking trajectory lengths are shown in Figure 1.


Figure 1: see blog post

Figure 2 shows the trajectory for 27859 using a logarithmic scale for the vertical axis.


Figure 2: permalink

The trajectory is as follows ending in a 7, 1, 14, 7 loop. The maximum value reached is an impressive \( \textbf{1,004,280,846,804} \). That's just over a trillion. That's why a logarithmic scale was needed for the vertical axis!

27859, 362168, 181084, 90542, 45271, 588524, 294262, 147131, 1912704, 956352, 478176, 239088, 119544, 59772, 29886, 14943, 4981, 64754, 32377, 420902, 210451, 2735864, 1367932, 683966, 341983, 4445780, 2222890, 1111445, 222289, 2889758, 1444879, 18783428, 9391714, 4695857, 61046142, 30523071, 10174357, 132266642, 66133321, 859733174, 429866587, 5588265632, 2794132816, 1397066408, 698533204, 349266602, 174633301, 2270232914, 1135116457, 14756513942, 7378256971, 95917340624, 47958670312, 23979335156, 11989667578, 5994833789, 856404827, 11133262752, 5566631376, 2783315688, 1391657844, 695828922, 347914461, 115971487, 1507629332, 753814666, 376907333, 34264303, 445435940, 222717970, 111358985, 22271797, 289533362, 144766681, 1881966854, 940983427, 12232784552, 6116392276, 3058196138, 1529098069, 19878274898, 9939137449, 129208786838, 64604393419, 839857114448, 419928557224, 209964278612, 104982139306, 52491069653, 4771915423, 433810493, 5639536410, 2819768205, 939922735, 187984547, 2443799112, 1221899556, 610949778, 305474889, 101824963, 1323724520, 661862260, 330931130, 165465565, 33093113, 430210470, 215105235, 71701745, 14340349, 186424538, 93212269, 1211759498, 605879749, 7876436738, 3938218369, 51196838798, 25598419399, 3656917057, 47539921742, 23769960871, 309009491324, 154504745662, 77252372831, 1004280846804, 502140423402, 251070211701, 83690070567, 27896690189, 362656972458, 181328486229, 60442828743, 20147609581, 1831600871, 23810811324, 11905405662, 5952702831, 1984234277, 25795045602, 12897522801, 4299174267, 1433058089, 18629755158, 9314877579, 3104959193, 443565599, 5766352788, 2883176394, 1441588197, 480529399, 68647057, 892411742, 446205871, 5800676324, 2900338162, 1450169081, 18852198054, 9426099027, 3142033009, 40846429118, 20423214559, 1856655869, 24136526298, 12068263149, 4022754383, 52295806980, 26147903490, 13073951745, 4357983915, 1452661305, 484220435, 96844087, 1258973132, 629486566, 314743283, 4091662680, 2045831340, 1022915670, 511457835, 170485945, 34097189, 4871027, 695861, 9046194, 4523097, 1507699, 19600088, 9800044, 4900022, 2450011, 31850144, 15925072, 7962536, 3981268, 1990634, 995317, 12939122, 6469561, 924223, 12014900, 6007450, 3003725, 600745, 120149, 1561938, 780969, 260323, 37189, 483458, 241729, 3142478, 1571239, 20426108, 10213054, 5106527, 66384852, 33192426, 16596213, 5532071, 71916924, 35958462, 17979231, 5993077, 77910002, 38955001, 506415014, 253207507, 36172501, 470242514, 235121257, 33588751, 4798393, 62379110, 31189555, 6237911, 81092844, 40546422, 20273211, 6757737, 2252579, 321797, 45971, 597624, 298812, 149406, 74703, 24901, 323714, 161857, 2104142, 1052071, 13676924, 6838462, 3419231, 44450004, 22225002, 11112501, 3704167, 48154172, 24077086, 12038543, 1094413, 14227370, 7113685, 1422737, 18495582, 9247791, 3082597, 440371, 5724824, 2862412, 1431206, 715603, 102229, 1328978, 664489, 94927, 13561, 176294, 88147, 1145912, 572956, 286478, 143239, 1862108, 931054, 465527, 6051852, 3025926, 1512963, 504321, 168107, 2185392, 1092696, 546348, 273174, 136587, 45529, 4139, 53808, 26904, 13452, 6726, 3363, 1121, 14574, 7287, 2429, 347, 4512, 2256, 1128, 564, 282, 141, 47, 612, 306, 153, 51, 17, 222, 111, 37, 482, 241, 3134, 1567, 20372, 10186, 5093, 463, 6020, 3010, 1505, 301, 43, 560, 280, 140, 70, 35, 7, 1, 14, 7

Wednesday, 2 July 2025

Prime Factor Sequences

I'm surprised I've not come across this type of sequence before. It has two variants and they are generated iteratively as follows:

  • number --> sum of prime factors without multiplicity
    For example, 24 with factors of 2 and 3 gives 5 and terminates after just one step

  • number --> sum of prime factors with multiplicity
    For example, 24 with factors of 2, 2, 2 and 3 gives 11 and terminates after just one step
Larger numbers of course take more than one step to terminate and it's of interest to consider those numbers that set records in term of trajectory lengths. In this context, let's consider OEIS A047830.


A047830  least number which becomes prime after exactly \(n\) iterations of f(\(x\)) = sum of prime factors of \(x\).


The members of this sequence are 4, 14, 26, 62, 134, 393, 1774, 13682, 41037 up to 100,000. The trajectories are shown in Figure 1 with length indicating the number of steps or iterations:


Figure 1: permalink

If the sum of prime factors with multiplicity is considered then we get OEIS A121360 with sequence members 1, 8, 14, 26, 62, 134, 393, 1257, 4659, 9314, 27933 up to 100,000. The trajectories are shown in Figure 2 with length indicating the number of steps or iterations:



Figure 2: permalink

The algorithms used to find the trajectories of record lengths can be easily modified to find numbers with trajectories of a specified length (number of steps or iterations). For example, how many numbers in the range up to 40000 require eight steps to reach a prime under the sum of prime factors without multiplicity algorithm. Here are the numbers (with 13682 being the first as we know already from Figure 1):

13682, 18002, 19137, 22934, 24014, 24787, 27364, 27849, 30062, 30993, 32577, 33477, 35410, 35798, 36004, 36398, 36706, 39206

These numbers are the initial members of OEIS A047827. Figure 3 shows the details of their trajectories:


Figure 3: permalink

Monday, 16 June 2025

A Special 29x + 1 Map

 In blog posts titled:

I've looked at Collatz-style sequences of the form \(px+1\) that map a number \(n\) to the following:
  • \(n \rightarrow \dfrac{n}{2}\) if \(2 \, | \, n\)
  • \(n \rightarrow \dfrac{n}{3}\) if \(3 \, | \, n\)
  • \(n \rightarrow \dfrac{n}{5}\) if \(5 \, | \, n\)
     \(\dots\)
  • \(n \rightarrow \dfrac{n}{p-1}\) if \((p-1) \, | \, n\)
  • \(n \rightarrow p \times n+1\) \( \text{ if none of the primes less than }p \text{ divide } n\)
Other mappings are of course possible and the following is perhaps the simplest of all. For a given prime \(p\) when applied to a number \(n\), the rule is:
  • \(n \rightarrow \dfrac{n}{2}\) if \(n\) is even
  • \(n \rightarrow p \times n + 1\) if \(n\) is odd
For \(p=3\), this is the Collatz trajectory of the number. Let's apply this sort of modified \(px+1\) mapping in the case of \(n=3\). The sequence formed by the trajectory up to one million is then (permalink):

3, 88, 44, 22, 11, 320, 160, 80, 40, 20, 10, 5, 146, 73, 2118, 1059, 30712, 15356, 7678, 3839, 111332, 55666, 27833, 807158, 403579, 11703792, 5851896, 2925948, 1462974, 731487 (OEIS A037112)

The trajectory is shown in Figure 1 using a logarithmic scale for the \(y\) axis:


Figure 1: permalink

By contrast if the first mentioned rule above were applied then the trajectory would be short-lived indeed:$$3 \rightarrow  1 \rightarrow  30 \rightarrow  15 \rightarrow 5 \rightarrow  1$$It can be seen that the trajectory very quickly enters a loop. 

Letting \(p=101\) and applying the mapping to \(n=3\) once again, we get the following sequence up to one million formed by the trajectory (permalink):

3, 304, 152, 76, 38, 19, 1920, 960, 480, 240, 120, 60, 30, 15, 1516, 758, 379, 38280, 19140, 9570, 4785, 483286, 241643

The trajectory is shown in Figure 2 using a logarithmic scale for the \(y\) axis:

Figure 2: permalink

Monday, 19 May 2025

The 17x + 1 Map Revisited

It's been a while, over seven years in fact since I last mentioned the 17\(x\) + 1 map in an eponymous post in March of 2018. As I explained back then:
Having recently written yet again about the Collatz trajectory, I was pleasantly surprised today to come upon a more generalised version of it. It goes by the name of the P\(x\) + 1 map of which the Collatz trajectory is a specific example in which P = 3. The P\(x\) + 1 trajectory or map is an algorithm that states: 

If \(x\) is divisible by any prime < P then divide out these primes one at a time starting with the smallest; otherwise multiply \(x\) by P and add 1.

My number for today is 25186 and it appears as an entry in OEIS A057534 that states:
  • a(\(n\) +1) = a(\(n\))/2 if 2 | a(\(n\))
  • a(\(n\)+1) = a(\(n\)) / 3 if 3 | a(\(n\))
  • a(\(n\)+1) = a(\(n\)) / 5 if 5 | a(\(n\))
  • a(\(n\)+1) = a(\(n\)) / 7 if 7 | a(\(n\))
  • a(\(n\)+1) = a(\(n\)) / 11 if 11 | a(\(n\))
  • a(\(n\)+1) = a(\(n\)) / 13 if 13 | a(\(n\))
  • else a(\(n\)+1) = 17 x a(\(n\)) + 1
This is a particular example of the P\(x\) + 1 map in which P = 17 and this generates a sequence, part of which is shown below:

61, 1038, 519, 173, 2942, 1471, 25008, 12504, 6252, 3126, 1563, 521, 8858, 4429, 75294, 37647, 12549, 4183, 71112, 35556, 17778, 8889, 2963, 50372, 25186, 12593, 1799, 257, 4370, 2185, 437, 7430, 3715, 743, 12632, 6316, 3158, 1579, 26844, 13422, ...

Well, that was then, and so let's write out the above sequence in full because it is finite and loops. Here are the 84 terms (or 83 steps) with 61 added at the end to show the return to source:

61, 1038, 519, 173, 2942, 1471, 25008, 12504, 6252, 3126, 1563, 521, 8858, 4429, 75294, 37647, 12549, 4183, 71112, 35556, 17778, 8889, 2963, 50372, 25186, 12593, 1799, 257, 4370, 2185, 437, 7430, 3715, 743, 12632, 6316, 3158, 1579, 26844, 13422, 6711, 2237, 38030, 19015, 3803, 64652, 32326, 16163, 2309, 39254, 19627, 333660, 166830, 83415, 27805, 5561, 94538, 47269, 803574, 401787, 133929, 44643, 14881, 252978, 126489, 42163, 3833, 65162, 32581, 553878, 276939, 92313, 30771, 10257, 3419, 263, 4472, 2236, 1118, 559, 43, 732, 366, 183, 61

Why am I discussing this sequence again today? Well, the number associated with my diurnal age today (\( \textbf{27805} \)) is a member of this sequence. We can see this more clearly if we arrange the terms in ascending order.

43, 61, 173, 183, 257, 263, 366, 437, 519, 521, 559, 732, 743, 1038, 1118, 1471, 1563, 1579, 1799, 2185, 2236, 2237, 2309, 2942, 2963, 3126, 3158, 3419, 3715, 3803, 3833, 4183, 4370, 4429, 4472, 5561, 6252, 6316, 6711, 7430, 8858, 8889, 10257, 12504, 12549, 12593, 12632, 13422, 14881, 16163, 17778, 19015, 19627, 25008, 25186, 26844, \( \textbf{27805} \), 30771, 32326, 32581, 35556, 37647, 38030, 39254, 42163, 44643, 47269, 50372, 64652, 65162, 71112, 75294, 83415, 92313, 94538, 126489, 133929, 166830, 252978, 276939, 333660, 401787, 553878, 803574

We can see that after 25186, the number that prompted my original post, there has only been one other member (26844) until today. If we start with 27805 then the sequence returns to this same number after 85 iterations (permalink):

27805, 5561, 94538, 47269, 803574, 401787, 133929, 44643, 14881, 252978, 126489, 42163, 3833, 65162, 32581, 553878, 276939, 92313, 30771, 10257, 3419, 263, 4472, 2236, 1118, 559, 43, 732, 366, 183, 61, 1038, 519, 173, 2942, 1471, 25008, 12504, 6252, 3126, 1563, 521, 8858, 4429, 75294, 37647, 12549, 4183, 71112, 35556, 17778, 8889, 2963, 50372, 25186, 12593, 1799, 257, 4370, 2185, 437, 7430, 3715, 743, 12632, 6316, 3158, 1579, 26844, 13422, 6711, 2237, 38030, 19015, 3803, 64652, 32326, 16163, 2309, 39254, 19627, 333660, 166830, 83415, 27805

Figure 1 shows a plot of these values using a logarithmic scale:


Figure 1: permalink

Now this sequence of length 84 or 83 steps is not the longest by far, In fact as the numbers get larger then the lengths of the record breaking sequence lengths also increases steadily. Table 1 shows these record step lengths for numbers up to 40000 as well as indicating whether the sequences end up looping or reaching 1.

\( \textbf{17x + 1} \)


Table 1: record step lengths of 17\(x\) + 1
permalink

It must be said the generation of this table timed out using SageMathCell and needed to be completed in my Jupyter notebook. While we are on the topic, we should look at the record step lengths for primes 3, 5, 7, 11 and 13 as well. Let's start with 13\(x\) + 1. The numbers with record breaking steps are as follows (with Table 2 showing more detail):

1, 2, 4, 8, 13, 26, 41, 61, 122, 197, 271, 529, 661, 1322, 1607, 3214, 4337, 4597, 4981, 7663, 15326, 27859
\( \textbf{13x + 1} \)


Table 2: record step lengths of 13\(x\) + 1
permalink

The numbers with record breaking steps for P11 + 1 are as follows (with Table 3 showing more detail):

1, 2, 4, 8, 11, 22, 23, 46, 92, 151, 247, 407, 653, 883, 977, 1313, 1703, 2477, 4954, 6847, 12449, 14471, 19013, 21527, 22627, 39281

\( \textbf{11x + 1} \)

Table 3: record steps lengths of 11\(x\) + 1
permalink

The numbers with record steps for P7 + 1 are (with Table 4 showing more details):

1, 3, 6, 7, 11, 19, 31, 49, 53, 106, 121, 163, 283, 343, 403, 806, 1471, 1681, 1919, 3133, 4243, 4849, 8659, 11683, 12373, 24746, 30301, 35803

\( \textbf{7x + 1} \)


Table 4: record step lengths of 7\(x\) + 1
permalink

The numbers with record steps for P5+1 are (with Table 5 showing more details):

1, 2, 4, 5, 10, 20, 23, 46, 47, 85, 95, 190, 380, 383, 766, 919, 1655, 2117, 3575, 6097, 6503, 10463, 12053, 24106, 28927, 39053

\( \textbf{5x + 1} \)

Table 5: record steps lengths of 5\(x\) + 1
permalink

The numbers with record lengths for P3 + 1 (with Table 6 showing more details) are:

1, 3, 6, 7, 9, 18, 25, 27, 54, 73, 97, 129, 171, 231, 313, 327, 649, 703, 871, 1161, 2223, 2463, 2919, 3711, 6171, 10971, 13255, 17647, 23529, 26623, 34239, 35655

\( \textbf{3x + 1} \)

Table 6: record lengths for 3\(x\) + 1
permalink

If we collect all the numbers from all the sequences above then we have a list of all the numbers that reach a record number of steps under the P\(x\) + 1 mappings where \(x\) = 3, 5, 7, 11, 13 and 17. Here is the list in the range from 1 to 40,000:

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 18, 19, 20, 22, 23, 25, 26, 27, 31, 41, 43, 46, 47, 49, 53, 54, 61, 73, 85, 92, 95, 97, 106, 121, 122, 129, 151, 163, 171, 173, 183, 190, 197, 231, 247, 257, 263, 271, 283, 313, 327, 343, 366, 380, 383, 403, 407, 437, 519, 521, 529, 559, 649, 653, 661, 703, 732, 743, 766, 806, 871, 883, 919, 977, 1038, 1118, 1161, 1313, 1322, 1471, 1563, 1579, 1607, 1655, 1681, 1703, 1799, 1919, 2117, 2185, 2223, 2236, 2237, 2309, 2463, 2477, 2919, 2942, 2963, 3126, 3133, 3158, 3214, 3419, 3575, 3711, 3715, 3803, 3833, 4183, 4243, 4337, 4370, 4429, 4472, 4597, 4849, 4954, 4981, 5561, 6097, 6171, 6252, 6316, 6503, 6711, 6847, 7430, 7663, 8659, 8858, 8889, 10257, 10463, 10971, 11683, 12053, 12373, 12449, 12504, 12549, 12593, 12632, 13255, 13422, 14471, 14881, 15326, 16163, 17647, 17778, 19013, 19015, 19627, 21527, 22627, 23529, 24106, 24746, 25008, 25186, 26623, 26844, 27805, 27859, 28927, 30301, 30771, 32326, 32581, 34239, 35556, 35655, 35803, 37647, 38030, 39053, 39254, 39281

Wednesday, 15 January 2025

Collatz Trajectory Crossing Records

One of the properties associated with my diurnal age's number (27681) is that it is a member of OEIS A319738:


 A319738: Numbers whose Collatz trajectories cross their initial values a record number of times.

The initial members of the sequence are: 1, 3, 6, 9, 14, 18, 33, 54, 97, 129, 194, 257, 294, 313, 342, 353, 398, 417, 470, 626, 9225, 13739, 14473, 19297, 27681, 38881 (permalink)

Table 1 shows the progressive records (permalink):


Table 1

Figure 1 shows the Collatz trajectory of 27681 in which there are 61 crossings (permalink):


Figure 1

These record crossings are rather rare and I don't know if I'll experience the next one. I'll be 38881 days old which I'm unlikely to reach. The reason that I've never encountered these record number of crossings before is that the previous one occurred when I was 
19297 days old, long before I started this daily number analysis.

Wednesday, 27 November 2024

Prime and Non-Prime Digit Sequence

I've posted extensively about the trajectories formed by repeatedly adding the sum of the odd digits of a number to the number itself while subtracting the sum of the even digits, or vice versa. My most recent post was on this topic was titled Revisiting Odds And Evens. Instead of dealing with odd and even digits, trajectories involving prime and non-prime digit sums can be considered. The prime digits are 2, 3, 5 and 7 while the non-prime digits are 0, 1, 4, 6, 7 and 9.

For example, the number associated with my diurnal age today is 27632 and it has the following trajectory of 3 steps under the prime and non-prime algorithm (permalink):

27632 --> 27640 --> 27639 --> 27636 --> 27636

The trajectory terminates when the number has a sum of primes and sum of non-primes that are equal, here 2 + 7 + 3 = 6 + 6. Numbers such as these are NOT listed in the OEIS but there is a listing for prime numbers with this property. There are 137 such primes in the range up to 40,000.


A371352
: prime numbers such that the sum of their prime digits is equal to the sum of their nonprime digits.

The sequence begins (permalink):

167, 211, 541, 617, 761, 853, 1021, 1201, 1423, 1559, 1607, 1973, 2011, 2143, 2341, 2383, 2833, 3467, 3719, 3823, 3917, 4051, 4231, 4637, 4673, 5261, 5443, 5519, 5591, 6473, 6521, 6701, 7193, 7643, 7687, 7867, 8053, 8233, 8677, 9137, 9173, 9371, 9551, 10067, 10243, 10559, 10607, 10739, 10937, 10973, 11471, 11783, 12043, 12263, 12539, 12953, 13187, 13259, 13709, 13781, 13907, 14779, 14797, 15329, 15361, 15581, 15923, 16007, 16223, 17093, 17183, 17497, 17749, 17903, 18371, 18713, 18731, 19037, 19073, 19477, 20011, 20101, 20143, 20341, 20431, 21001, 22613, 23041, 23159, 24103, 25391, 25463, 25601, 25643, 25867, 25913, 25931, 26321, 26501, 28657, 29153, 29531, 30197, 30241, 30467, 30971, 31079, 31259, 31817, 31907, 32083, 32159, 32261, 32401, 32443, 32621, 32803, 33479, 33749, 34607, 34739, 35129, 35291, 36151, 37019, 37181, 37493, 37811, 37879, 37897, 37987, 38711, 38977, 39107, 39251, 39521, 39877

Many number trajectories will end in what I call an "attractor", using my Odds and Evens terminology. This is a number whose sums of prime and non-prime digits are equal. For completeness, here is a list of all the 446 NUMBERS (prime or composite) greater than 27630 and less than 40000 with the property that the sum of their prime digits equals the sum of their non-prime digits (permalink):

27636, 27658, 27663, 27685, 27788, 27801, 27810, 27834, 27843, 27856, 27865, 27878, 27887, 27900, 28017, 28033, 28071, 28107, 28125, 28152, 28170, 28215, 28222, 28251, 28303, 28330, 28347, 28374, 28437, 28455, 28473, 28512, 28521, 28545, 28554, 28567, 28576, 28657, 28675, 28701, 28710, 28734, 28743, 28756, 28765, 28778, 28787, 28877, 29007, 29025, 29052, 29070, 29135, 29153, 29205, 29223, 29232, 29250, 29315, 29322, 29351, 29502, 29513, 29520, 29531, 29700, 30036, 30058, 30063, 30085, 30111, 30124, 30142, 30179, 30197, 30214, 30238, 30241, 30283, 30306, 30328, 30339, 30360, 30382, 30393, 30412, 30421, 30445, 30454, 30467, 30476, 30508, 30544, 30580, 30603, 30630, 30647, 30674, 30719, 30746, 30764, 30791, 30805, 30823, 30832, 30850, 30917, 30933, 30971, 31011, 31024, 31042, 31079, 31097, 31101, 31110, 31134, 31143, 31156, 31165, 31178, 31187, 31204, 31226, 31240, 31259, 31262, 31295, 31314, 31338, 31341, 31383, 31402, 31413, 31420, 31431, 31516, 31529, 31561, 31592, 31615, 31622, 31651, 31709, 31718, 31781, 31790, 31817, 31833, 31871, 31907, 31925, 31952, 31970, 32014, 32038, 32041, 32083, 32104, 32126, 32140, 32159, 32162, 32195, 32216, 32229, 32261, 32292, 32308, 32344, 32380, 32401, 32410, 32434, 32443, 32456, 32465, 32478, 32487, 32519, 32546, 32564, 32591, 32612, 32621, 32645, 32654, 32667, 32676, 32748, 32766, 32784, 32803, 32830, 32847, 32874, 32915, 32922, 32951, 33006, 33028, 33039, 33060, 33082, 33093, 33114, 33138, 33141, 33183, 33208, 33244, 33280, 33309, 33318, 33381, 33390, 33411, 33424, 33442, 33479, 33497, 33600, 33749, 33794, 33802, 33813, 33820, 33831, 33903, 33930, 33947, 33974, 34012, 34021, 34045, 34054, 34067, 34076, 34102, 34113, 34120, 34131, 34201, 34210, 34234, 34243, 34256, 34265, 34278, 34287, 34311, 34324, 34342, 34379, 34397, 34405, 34423, 34432, 34450, 34504, 34526, 34540, 34559, 34562, 34595, 34607, 34625, 34652, 34670, 34706, 34728, 34739, 34760, 34782, 34793, 34827, 34872, 34937, 34955, 34973, 35008, 35044, 35080, 35116, 35129, 35161, 35192, 35219, 35246, 35264, 35291, 35404, 35426, 35440, 35459, 35462, 35495, 35549, 35594, 35611, 35624, 35642, 35679, 35697, 35769, 35796, 35800, 35912, 35921, 35945, 35954, 35967, 35976, 36003, 36030, 36047, 36074, 36115, 36122, 36151, 36212, 36221, 36245, 36254, 36267, 36276, 36300, 36407, 36425, 36452, 36470, 36511, 36524, 36542, 36579, 36597, 36627, 36672, 36704, 36726, 36740, 36759, 36762, 36795, 36957, 36975, 37019, 37046, 37064, 37091, 37109, 37118, 37181, 37190, 37248, 37266, 37284, 37349, 37394, 37406, 37428, 37439, 37460, 37482, 37493, 37569, 37596, 37604, 37626, 37640, 37659, 37662, 37695, 37789, 37798, 37811, 37824, 37842, 37879, 37897, 37901, 37910, 37934, 37943, 37956, 37965, 37978, 37987, 38005, 38023, 38032, 38050, 38117, 38133, 38171, 38203, 38230, 38247, 38274, 38302, 38313, 38320, 38331, 38427, 38472, 38500, 38711, 38724, 38742, 38779, 38797, 38977, 39017, 39033, 39071, 39107, 39125, 39152, 39170, 39215, 39222, 39251, 39303, 39330, 39347, 39374, 39437, 39455, 39473, 39512, 39521, 39545, 39554, 39567, 39576, 39657, 39675, 39701, 39710, 39734, 39743, 39756, 39765, 39778, 39787, 39877

Also for completeness, here is a list of all the numbers greater than 27630 and less than 40000 with the property they map back to themselves after two or more repetitions of the prime / non-prime algorithm. In other words, they are "vorticals" each belonging to a "vortex" to use my Odds and Evens nomenclature.

27675, 27684, 27690, 27823, 27829, 27837, 27848, 27855, 27866, 27873, 27884, 27922, 27926, 27933, 27939, 27954, 27955, 27964, 27965, 27972, 27981, 28027, 28030, 28272, 28273, 28277, 28279, 28282, 28287, 28352, 28355, 28356, 28362, 28532, 28536, 28553, 28560, 28723, 28729, 28737, 28748, 28755, 28766, 28773, 28784, 29272, 29276, 29372, 29373, 29377, 29379, 29382, 29387, 29507, 29511, 29512, 29552, 29553, 29557, 29559, 29566, 29567, 29570, 29575, 29580, 29585, 29722, 29726, 29733, 29739, 29754, 29755, 29764, 29765, 29772, 29781, 30003, 30009, 30012, 30016, 30075, 30084, 30090, 30102, 30106, 30135, 30138, 30145, 30148, 30259, 30260, 30277, 30286, 30296, 30342, 30346, 30378, 30383, 30384, 30387, 30391, 30392, 30432, 30436, 30453, 30460, 30562, 30566, 30652, 30655, 30656, 30662, 30782, 30786, 30795, 30801, 30872, 30876, 30927, 30930, 31002, 31006, 31035, 31038, 31045, 31048, 31123, 31129, 31137, 31148, 31155, 31166, 31173, 31184, 31213, 31219, 31276, 31281, 31359, 31360, 31377, 31386, 31396, 31407, 31411, 31412, 31452, 31453, 31457, 31459, 31466, 31467, 31470, 31475, 31480, 31485, 31543, 31549, 31579, 31584, 31672, 31673, 31677, 31679, 31682, 31687, 31763, 31769, 31827, 31830, 32059, 32060, 32077, 32086, 32096, 32113, 32119, 32176, 32181, 32243, 32249, 32279, 32284, 32362, 32366, 32423, 32429, 32437, 32448, 32455, 32466, 32473, 32484, 32582, 32586, 32632, 32636, 32653, 32660, 32793, 32797, 32799, 32806, 32807, 32811, 32852, 32855, 32856, 32862, 32972, 32973, 32977, 32979, 32982, 32987, 33042, 33046, 33078, 33083, 33084, 33087, 33091, 33092, 33159, 33160, 33177, 33186, 33196, 33262, 33266, 33363, 33369, 33402, 33406, 33435, 33438, 33445, 33448, 33583, 33589, 33592, 33596, 33622, 33626, 33633, 33639, 33654, 33655, 33664, 33665, 33672, 33681, 33807, 33811, 33812, 33852, 33853, 33857, 33859, 33866, 33867, 33870, 33875, 33880, 33885, 33952, 33955, 33956, 33962, 34032, 34036, 34053, 34060, 34107, 34111, 34112, 34152, 34153, 34157, 34159, 34166, 34167, 34170, 34175, 34180, 34185, 34223, 34229, 34237, 34248, 34255, 34266, 34273, 34284, 34302, 34306, 34335, 34338, 34345, 34348, 34472, 34476, 34513, 34519, 34576, 34581, 34742, 34746, 34778, 34783, 34784, 34787, 34791, 34792, 35062, 35066, 35143, 35149, 35179, 35184, 35282, 35286, 35383, 35389, 35392, 35396, 35413, 35419, 35476, 35481, 35602, 35606, 35635, 35638, 35645, 35648, 35822, 35826, 35833, 35839, 35854, 35855, 35864, 35865, 35872, 35881, 35932, 35936, 35953, 35960, 36052, 36055, 36056, 36062, 36172, 36173, 36177, 36179, 36182, 36187, 36232, 36236, 36253, 36260, 36322, 36326, 36333, 36339, 36354, 36355, 36364, 36365, 36372, 36381, 36502, 36506, 36535, 36538, 36545, 36548, 36713, 36719, 36776, 36781, 37082, 37086, 37163, 37169, 37293, 37299, 37442, 37446, 37478, 37483, 37484, 37487, 37491, 37492, 37613, 37619, 37676, 37681, 37802, 37806, 37835, 37838, 37845, 37848, 37923, 37929, 37937, 37948, 37955, 37966, 37973, 37984, 38072, 38076, 38127, 38130, 38252, 38255, 38256, 38262, 38307, 38311, 38312, 38352, 38353, 38357, 38359, 38366, 38367, 38370, 38375, 38380, 38385, 38522, 38526, 38533, 38539, 38554, 38555, 38564, 38565, 38572, 38581, 38702, 38706, 38735, 38738, 38745, 38748, 39027, 39030, 39272, 39273, 39277, 39279, 39282, 39287, 39352, 39355, 39356, 39362, 39532, 39536, 39553, 39560, 39723, 39729, 39737, 39748, 39755, 39766, 39773, 39784

Take for example, the first member of the above series of numbers:

27675 --> 27690 --> 27684 --> 27675

Here (27675, 27690, 27684) forms a vortex while the individual members (27675, 27690 and 27684) are vorticals. If a number is not an attractor or a vortical then it will captured either by an attractor or a vortex. For example, 27676 is captured by the vortex just mentioned:

27676 --> 27680 --> 27675 --> 27690 --> 27684 --> 27675

On the other hand, 27659 is captured by the attractor 27658:

27659 --> 27658 --> 27658

I've now included in my multipurpose algorithm the trajectory of a number under the prime and non-prime algorithm.