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

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

Saturday, 2 April 2022

26662

Well, not only is my diurnal age today (April 2nd 2022) an impressive palindrome (26662) but the date also marks my 73rd solar return. This is the day that the Sun returns to the exact position that it occupied at the time of my birth, namely 12°47'07" of Aries. The date of the solar return is always close to a person's official birthday but not necessarily the same as it. In my case, April 3rd is my official birthday.


I'll use this number as an excuse to revisit some mathematical topics that I haven't visited in quite a while. Let's begin:

COLLATZ TRAJECORY

What is the trajectory of 26662 under the 3\(x\)+1 recursive algorithm? The algorithm is applied to any positive integer \(n\):

\(n\) → \(n\)/2 (n is even)

\(n\) → 3\(n\) + 1 (n is odd)

Most, but not all, numbers reach 1. 26662 is no exception but it takes 95 steps. It's trajectory is:

26662, 13331, 39994, 19997, 59992, 29996, 14998, 7499, 22498, 11249, 33748, 16874, 8437, 25312, 12656, 6328, 3164, 1582, 791, 2374, 1187, 3562, 1781, 5344, 2672, 1336, 668, 334, 167, 502, 251, 754, 377, 1132, 566, 283, 850, 425, 1276, 638, 319, 958, 479, 1438, 719, 2158, 1079, 3238, 1619, 4858, 2429, 7288, 3644, 1822, 911, 2734, 1367, 4102, 2051, 6154, 3077, 9232, 4616, 2308, 1154, 577, 1732, 866, 433, 1300, 650, 325, 976, 488, 244, 122, 61, 184, 92, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1

Figure 1 shows a plot of these values:


Figure 1

ALIQUOT SEQUENCE

The aliquot sequence for an integer \(n\) is obtained from the recurrence relation:$$a_n=\sigma(a_{n-1})-a_{n-1}$$where \( \sigma(n) \) is the sum of divisors function. Most aliquot number sequences reach 0 but if an amicable number is encountered then it ends up alternating between the abundant and deficient member of the amicable pair. Such is the case with 26662 where the amicable number pair (2924, 2620) is reached. Here is the trajectory:

26662 --> 13334 --> 7186 --> 3596 --> 3124  --> 2924 --> 2620 --> 2924

ANTI-DIVISORS

While 26662 may only have four divisors (1, 2, 13331 and 26662), it has a larger number of anti-divisors. These are:

3, 4, 5, 9, 15, 25, 27, 45, 75, 79, 135, 225, 237, 395, 675, 711, 1185, 1975, 2133, 3555, 5925, 10665, 17775

I've made two posts about anti-divisors. One is titled Anti-divisors on February 26th 2016 and another, more comprehensive, post on February 28th 2021 titled More on Anti-divisors.

ARITHMETIC DERIVATIVE

The arithmetic derivative of a natural number \(n\) is given by:$$ \begin{align} p'&=1 \text{ for any prime }p\\(pq)'&=p'q+pq' \text{ for any } p,q \in \mathbb{N } \end{align}$$The arithmetic derivative of 26662 is thus:$$ \begin{align}  26662'  &= (2 \times 13331)'\\&= 2' \times 13331 + 2 \times 13331'  \\&= 13331+2\\&=13333\end{align}$$

DIGIT MANIPULATION

Suppose we have a number such as 26662 and we want to rearrange its digits in such a way that the maximum and minimum possible numbers are created. This would give us 66622 as a maximum and 22666 as a minimum. Furthermore, let’s suppose we want to subtract the minimum from the maximum to get 43956 and then repeat this digital manipulation repeatedly until some resolution is reached. 

In this case, the trajectory of 26662 looks like this: 

26662 --> 43956 --> 61974 --> 82962 --> 75933 -->  63954 --> 61974

As can be seen, a loop has been entered {61974, 82962, 75933, 63954}. Most numbers enter a loop but sometimes 0 is reached if a number like 999 is encountered.

GOLDBACH DECOMPOSITION

Goldbach’s conjecture states that every even number can be expressed as a sum of two primes. There are many such decompositions for any given number (see my post Goldbach’s Conjecture Revisited) but the one containing the smallest and largest prime is known as the minimal decomposition.

There are 439 Goldback decompositions of 26662

The minimal decomposition is (24593, 2069)

HOME PRIME

The home prime of a number n is the prime reached by concatenating its prime factors (in the order smallest to largest) and repeating until a prime is reached. In the case of 26662, only three steps are required:

26662 = 2 x 13331 --> 213331 = 383 x 557 --> 383557

MULTIPLICATIVE PERSISTENCE

The multiplicative persistence of a number counts the number of steps required to reach a fixed number (often zero) when the digits are multiplied together. 26662 has a multiplicative persistence of 4:

26662 --> 864 --> 192 --> 18 --> 8

A variation of this, that I came up with, is to add this product to the original number. So the 864 from the initial product of digits is added to 26662 to give 27526 and this process is repeated until a number with a zero is reached, after which there can be no further change. The trajectory for 26662 is:

26662 --> 27526 --> 28366 --> 30094

ODDS 'n EVENS

This algorithm takes a number and applies the following recursive process to the number: add the sum of its odd digits to the number and subtract the sum of the even digits, repeating this process until a stable number is reached.  The trajectory of 26662 is as follows:

26662 --> 26640 --> 26622 --> 26604 --> 26586 --> 26569 --> 26569

Thus 26662 is a captive of the attractor 26569 that has a total of 92 captives.

PALINDROME

26662 is of course a palindrome but it has the interesting property that its two prime factors (2 and 13331) are also palindromic (2 of course trivially so). 26662 is also palindromic in base 8 (64046).

I'll leave off there but this post was useful for me in that I was reminded of many concepts that I hadn't encountered in quite a while. I simply made my way through my Google document where I've recorded these concepts over the past few years and applied them to this particular number. It's something that I should do on a regular basis, perhaps even writing a program that would automatically generate this information for a given number. That would be useful!

ADDENDUM: added April 7th 2022

In fact, I did write such a program as alluded to in the paragraph above. Here is a permalink to SageMathCell using 26667 as an example. The output is:

The Collatz Trajectory for 26667 is:
[26667, 80002, 40001, 120004, 60002, 30001, 90004, 45002, 22501, 67504, 33752, 16876, 8438, 4219, 12658, 6329, 18988, 9494, 4747, 14242, 7121, 21364, 10682, 5341, 16024, 8012, 4006, 2003, 6010, 3005, 9016, 4508, 2254, 1127, 3382, 1691, 5074, 2537, 7612, 3806, 1903, 5710, 2855, 8566, 4283, 12850, 6425, 19276, 9638, 4819, 14458, 7229, 21688, 10844, 5422, 2711, 8134, 4067, 12202, 6101, 18304, 9152, 4576, 2288, 1144, 572, 286, 143, 430, 215, 646, 323, 970, 485, 1456, 728, 364, 182, 91, 274, 137, 412, 206, 103, 310, 155, 466, 233, 700, 350, 175, 526, 263, 790, 395, 1186, 593, 1780, 890, 445, 1336, 668, 334, 167, 502, 251, 754, 377, 1132, 566, 283, 850, 425, 1276, 638, 319, 958, 479, 1438, 719, 2158, 1079, 3238, 1619, 4858, 2429, 7288, 3644, 1822, 911, 2734, 1367, 4102, 2051, 6154, 3077, 9232, 4616, 2308, 1154, 577, 1732, 866, 433, 1300, 650, 325, 976, 488, 244, 122, 61, 184, 92, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1]
There are 170 steps required to reach 1

The Aliquot Sequence for 26667 is:
[26667, 11865, 10023, 4425, 3015, 2289, 1231, 1, 0]

The Anti-Divisors of 26667 are:
[2, 5, 6, 7, 18, 19, 133, 401, 2807, 5926, 7619, 10667, 17778]

The Arithmetic Derivative of 26667 is 17787

The Maximum - Minimum Recursive Algorithm for 26667 produces:
[26667, 49995, 53955, 59994, 53955]

There are no Goldback Decompositions of 26667 because it is odd.

number of steps required is to reach home prime is 6 :
[26667, 332963, 378999, 33334679, 733114387, 2969246923]

The multiplicative persistence of 26667 is as follows:
[26667, 3024, 0]

26667 has Odds and Evens Trajectory of length 6 and is:
[26667, 26654, 26641, 26624, 26604, 26586, 26569, 26569]

Saturday, 3 April 2021

Patterns in Collatz Trajectories

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


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

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

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

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


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



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

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


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

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


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

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

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

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

Monday, 10 August 2020

Palindromic Cyclops Numbers

The photo pretty well sums up how I'm feeling today and today is a palindromic cyclops number day. I'm currently 26062 days old. My last such day was obviously 25052 and my next will be 27072. Mathematically, there is nothing deeply significant about such numbers. They are a peculiarity of the base ten number system. In other number bases, the number is not palindromic, as can be seen in Figure 1:

Figure 1: source

By contrast, primeness is intrinsic to the number itself and is independent of the base being used to express the number. The base-dependent peculiarities however, still exert a powerful fascination over numberphiles. Figure 2 shows a fancy font representation of 26062. Sometimes it's nice to just enjoy the symmetry of a number and to admire its representation in an artistic font.



In a more mathematically appreciative world, people might celebrate their palindromic cyclic days in the same way that they celebrate their birthdays. They only occur about every three years, so they are rather special. Instead, these days pass by unnoticed for most of humanity. In 600 days time, I'll turn 26662 days old. As well as being palindromic, the central three digits form the number of the beast: 666.

Digit patterns such as 26062 displays are also useful in strengthening numeracy in young children. A simple exercise might be as follows: given the digits 0, 2, 2, 6, 6, arrange them in such a way that the resultant number reads the same from left to right. Two arrangements of course are possible: 26062 and 62026.

From the shallow waters of exercises like the previous one, it's easy to get into deep waters fairly quickly. For example, 26062 has the property that, when it is tripled and 1 is added, the result is also a palindrome: 78187. This tripling and adding one reminded me of the Collatz conjecture that I've written about in earlier posts. However, in the Collatz the rule is that for an even number like 26062, the number is halved and so, in the case of 26062, the result is 13031 (incidentally, also palindromic). I got to thinking: how would a sort of reversed Collatz sequence behave? What is I mean is explained by the following rule for a given number \(n\):
  • if \(n\) is even, \(n \rightarrow 3n+1\)
  • if \(n\) is odd, \( n \rightarrow \dfrac{n-1}{2} \)
Now the Collatz rule is the opposite of this and, as far as is known, always leads to 1. However, for this reversed version, I found that the sequence started to loop once it reached 40 (going back to 121 - shown in blue). Here is the sequence:

26062, 78187, 39093, 19546, 58639, 29319, 14659, 7329, 3664, 10993, 5496, 16489, 8244, 24733, 12366, 37099, 18549, 9274, 27823, 13911, 6955, 3477, 1738, 5215, 2607, 1303, 651, 325, 162, 487, 243, 121, 60, 181, 90, 271, 135, 67, 33, 16, 49, 24, 73, 36, 109, 54, 163, 81, 40

A little experimenting showed that some numbers go to 1. For example, here is the sequence for 1000:

1000, 3001, 1500, 4501, 2250, 6751, 3375, 1687, 843, 421, 210, 631, 315, 157, 78, 235, 117, 58, 175, 87, 43, 21, 10, 31, 15, 7, 3, 1

999 on the other hand enters a different loop to that of 26062. It would be interesting to explore the different results in a future post but here I'm just illustrating how there can be complexity hiding in apparent simplicity when exploring the properties of a number.

While on the subject of 26062, it can be noted that it has the interesting property that the sum of its prime divisors is also a palindrome (242). It is in fact a member of OEIS A046354:


A046354

Composite palindromes whose sum of prime factors is palindromic (counted with multiplicity).


The sequence runs 4, 6, 8, 9, 121, 292, 444, 575, 717, 828, 989, 1331, 2002, 4884, 5445, 8668, 9559, 10201, 11211, 11811, 13231, 14241, 14541, 14641, 15251, 15751, 16261, 16761, 18281, 19291, 19591, 20002, 21112, 21312, 22022, 22922, 23832, 26062, ...

It can be generated using the following SageMath code (permalink):

P=[]
for number in [1..26062]:
    N=number.digits()
    s=""
    for n in N:
        s+=str(n)
    if number==int(s):
        P.append(number)
L=[]
for p in P:
    if is_prime(p)==0:
        sum=0
        M=list(factor(p))
        for m in M:
            sum+=m[0]*m[1]
        if sum in P:
            L.append(p)
print(L)

Sunday, 25 August 2019

The PrimeLatz Conjecture

The PrimeLatz Conjecture is so named in deference to and because of its similarity to the Collatz Conjecture that I've written about in earlier posts, namely:
The so-called Collatz Trajectory refers to the sequence of numbers generated by the following rule. Start with any positive integer. If the number is even, divide it by 2. If the number is odd, multiply by 3 and add 1. The conjecture is that the sequence of numbers thus generates will always lead to 1. So far, no exceptions have been found.

The PrimeLatz Trajectory is similar except that for odd numbers, the rule is to add the next three primes to the number. This will always generate an even number that is then divided by 2. The PrimeLatz Conjecture is that the sequence of numbers thus generated will always lead to a loop.

Take the case of 82. Here is the sequence:

82 41 184 92 46 23 120 60 30 15 74 37 168 84 42 21 104 52 26 13 72 36 18 9 50 25 122 61 272 136 68 34 17 88 44 22 11 60 ...

The sequence repeats after 11 is reached. Because 11 is odd, the next three primes are added. Thus 11 + 13 + 17 + 19 = 60 but 60 was reached earlier when 120 was divided by 2. Let's take another example, this time 84. The sequence is:

84 42 21 104 52 26 13 72 36 18 9 50 25 122 61 272 136 68 34 17 88 44 22 11 60 30 15 74 37 168 84 ...


Most numbers fall into a loop fairly quickly but what's of interest are those numbers that are more stubborn, such as 83. I deliberately chose numbers that were one above and one below 83 to emphasise the difference. Here is what the OEIS says about the behaviour of 83 where \(a(n)\) represents the sequence of terms:
Most small initial values have a very small orbit of few more than the 30 elements of the loop. 
N = 83 = a(0) is the most remarkable exception (having an orbit of 16180 + 30 elements), which motivates this sequence.  
N = 443 = A293978(0) is another exception, with an orbit of 9066+30 elements, and N = 209 also has a comparatively large orbit of 941 + 30 elements, distinct from those of 83 and 443.
The initial value a(0) = 83 is odd, so we add to 83 the next 3 primes (89, 97 and 101) to get a(1) = 370. 
370 is even, so we divide by 2 to get a(2) = 185, and so on. 
After 8337 iterations, we get a(8337) = 10780054699424618132644155893087038044817868609971935265882538442720. 
This is the largest value we will reach. Since this is even we divide by 2 to get a(8338). The result a(8338) is again even, so we divide by 2 once more to get a(8339), and so on... 
After iteration 16171, we reach a(16171) = 768. The next 8 iterations consist in dividing by 2, until we get a(16179) = 3. Since this is odd, we add the next three primes (5, 7 and 11) to reach a(16180) = 26 = A193230(14). This is an element of the loop: 30 iterations later, we get again 26, and the sequence has become periodic.
All numbers less than 100 million eventually fall into the following loop:
9,50,25,122,61,272,136,68,34,17,88,44,22,11,60,
30,15,74,37,168,84,42,21,104,52,26,13,72,36,18

ADDENDUM 10th May 2020:

I'm now approaching my 26000th day on Earth and I've noticed that, in the orbit of 83, there is a cluster of numbers between 25000 and 31000 with wide gaps on either side. Figure 1 shows what I mean:

Figure 1

There is a gap of over 10000 from 15456 to 25710 and then a gap of over 20000 from 30912 to 51536. As I write this on the 10th May 2020, I'm 25970 days old and this number is in the 83 orbit. There are a total of 54 numbers that fall in the range from 25710 to 30912.

The full orbit of 83 can be viewed, in comma-delimited format, by following this link (it's 176 pages long):

https://docs.google.com/document/d/1uP-sBqDNjbhkEqK8IEDG-doN2QeYXnq0K8QObWkzPWU/edit?usp=sharing


Monday, 19 March 2018

The 13x+1 and 11x+ 1 Maps

13x+1

Having looked at the 17x+1 map is my previous post, it was seen at 43 and 61 were special in the sense that they returned to their starting point after 84 steps, whereas every other prime from 17 to 97 terminated in at most 56 steps. Working again in Google Sheets, I applied the 13x+1 algorithm to the primes between 17 and 109. For any integer N>11, the algorithm is as follows:
  • IF 2|N THEN N --> N/2 
  • IF 3|N THEN N --> N/3 
  • IF 5|N THEN N --> N/5 
  • IF 7|N THEN N --> N/7 
  • IF 11|N THEN N --> N/11 
  • ELSE N --> 13*N+1
Here are the results and, for 13x+1, it appears that 19 and 101 are special in that they are the only primes so far that I've found to return to their starting point (151 joins the trajectory of 19 after 10 steps):
  • 13 terminates after 25 steps
  • 17 terminates after 23 steps
  • 19 repeats after 15 steps
  • 23 terminates after 6 steps
  • 29 terminates after 6 steps
  • 31 repeats after 15 steps (overlaps with trajectory of 19)
  • 37 terminates after 20 steps
  • 41 terminates after 40 steps
  • 43 terminates after 7 steps
  • 47 terminates after 28 steps
  • 53 terminates after 10 steps
  • 59 terminates after 10 steps
  • 61 terminates after 10 steps
  • 67 terminates after 60 steps
  • 71 terminates after 6 steps
  • 73 repeats after 15 steps (overlaps with trajectories of 19 and 31)
  • 79 terminates after 43 steps
  • 83 terminates after 8 steps
  • 89 terminates after 37 steps
  • 97 terminates after 24 steps
  • 101 repeats after 15 steps (overlaps with trajectories of 19, 31 and 73)
  • 103 terminates after 64 steps
  • 107 terminates after 12 steps
  • 109 terminates after 56 steps
The 19, 31, 73 and 101 sequences overlap as the diagram below shows (progression is anticlockwise):


Further investigation has shown that 151 joins the trajectory of 19 after 10 steps. Primes 113, 127, 131, 137, 139 and 149 all terminate. It will be interesting to investigate whether other non-terminating primes join this above circle.
My conjecture is that all numbers, under the 13x+1 algorithm, will either enter this loop or else get reduced to 1.

11x+1

For the 11x+1 map, the algorithm to be applied is that for any integer N>7:
  • IF 2|N THEN N --> N/2 
  • IF 3|N THEN N --> N/3 
  • IF 5|N THEN N --> N/5 
  • IF 7|N THEN N --> N/7  
  • ELSE N --> 11*N+1
Once again, most numbers terminate but there is a cycle as shown below, starting at 17 and proceeding in an anticlockwise direction:

My conjecture is that all numbers, under the 11x+1 algorithm, will either enter this loop or else get reduced to 1.
What I am seeing thus far with the Px+1 map is that values of P=17, 13 and 11 will reduce most numbers to 1 but in each case there is a set of prime numbers that form part of a cycle. I haven't tested for P=7 or 5 yet. However, we know that for P=3 there is no known cycle of this nature.

Sunday, 18 March 2018

The 17x+1 Map

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\)) / 3 if 3 | a(\(n\))
  • a(\(n\)) / 5 if 5 | a(\(n\))
  • a(\(n\)) / 7 if 7 | a(\(n\))
  • a(\(n\)) / 11 if 11 | a(\(n\))
  • a(\(n\)) / 13 if 13 | a(\(n\))
  • else 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, ...
I pondered long and hard over why 61 was chosen as the starting point for this sequence. Once a(0) = 63 then the other terms follow according to the algorithm but why start there? I used Google Sheets to investigate the matter. As shown below, the sequence repeats after 84 steps. I'll leave the numbers vertical as it's easier to scan them.

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

This still didn't explain why 61 was chosen as the starting point so I decided to investigate all the primes from 17 to 59 and from 67 up to 97. Here is a summary of my results:

17 terminates after 13 steps
19 terminates after 7 steps
23 terminates after 6 steps
29 terminates after 10 steps
31 terminates after 7 steps
37 terminates after 6 steps
41 terminates after 53 steps
43 repeats after 84 steps (joins 61 trajectory after 4 steps)
47 terminates after 8 steps
53 terminates after 56 steps (joins the 41 trajectory after 3 steps)
59 terminates after 13 steps
61 repeats after 84 steps
67 terminates after 12 steps
71 terminates after 15 steps
73 terminates after 11 steps
79 terminates after 9 steps
83 terminates after 36 steps
89 terminates after 9 steps
97 terminates after 6 steps

I thought it odd that 43 and 61 both repeated after 84 steps and closer investigation revealed that 43 is actually on the trajectory of 61 because of 43, 732, 366, 183, 61. So I guess 61 was chosen because it's the first sequence that loops instead of terminating. 43 also loops but actually joins the trajectory of 61 after 4 steps.

It would interesting be to explore what happens to larger primes under the 17\(x\) + 1 map and also to experiment with other values of P, all possible of course with a spreadsheet.
My conjecture is that there is just the single 61 loop as shown above and that any number not in that loop must either enter it or else get reduced to 1 sooner or later.