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

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


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.

Thursday, 15 March 2018

The Collatz Conjecture Revisited

Some time ago I posted about the Collatz Conjecture. Today's and yesterday's numbers (25183 and 25182 respectively) are connected to this conjecture. In general, these numbers arise because I'm tracking the number of days that I've been alive, numbering the day I was born (April 3rd 1949) as day zero and counting forward from there.

Both numbers appear in the Online Encyclopaedia of Integer Sequences (OEIS) A224303, whose members comprise numbers n for which number of iterations to reach the largest equals number of iterations to reach 1 from the largest in Collatz (3x+1) trajectory of n.

It's easy enough to set up a spreadsheet that calculates the number of steps to reach 1 and also the number of steps to reach the largest number in the trajectory. This is what I've done in Google Sheets and I've included a screenshot below for 25183.


As can be seen, 116 steps are required to get to the largest number (6,810,136) in the trajectory and then the same number of steps to reach 1, making for 232 steps in all. The steps for the previous number 25182 are the same. Here is a graph of the trajectory:


Looking at the sequence of such numbers, it's apparent that they tend to cluster and often appear in groups of two or more. Here is the list as it is shown in OEIS A224303 (with clusters shown in different colours):

1, 6, 120, 334, 335, 804, 1249, 2008, 2010, 2012, 2013, 6556, 6557, 6558, 6801, 6802, 6803, 7496, 7498, 7500, 7501, 7505, 10219, 22633, 25182, 25183, 27074, 27075, 27864, 27866, 27868, 31838, 31839, 32078, 36630, 36633, 36690, 36691, 36914, 39126, 39344

The second member of the sequence, 6, is given as an example: 6 is in the list because the Collatz trajectory of 6 is {6, 3, 10, 5, 16, 8, 4, 2, 1} and four steps are required to reach the largest number number (16) and four steps are required to reach 1 from 16:

6 --> 3 --> 10 --> 5 --> 16 and then 16 --> 8 --> 4 ---> 2 --> 1

Of course, there's a site on the Internet that will calculate the number of steps and graph the result. It also contains other interesting information relating to the Collatz conjecture. My spreadsheet will graph the trajectory but one has to manually alter the upper bound to get the best looking graph. I haven't figured out a way to adjust it automatically but I'll keep working on it.

Remember that the rule is to divide by 2 if the number is even and multiply by 3 and add 1 if the number is odd (hence the "3x+1 problem" as an alternative moniker). However, the site mentioned also allows one to customise the algorithm, so that for example instead of multiplying by 3, one can multiply by 2.


Interestingly, the trajectory still reaches 1 but it takes 669 steps and it's graph is quite different to that followed using the standard algorithm. Using larger multipliers like 4 doesn't seem to lead to convergence. For example after 10000 iterations using 4 as the multiplier, one gets 6,922,158,704,601,770. I'm not sure what happens with more iterations. The site also has a page for testing Lychrel numbers. I've looked at these sorts of numbers before but hadn't realised that they were called Lychrel numbers. I'd been referring to the algorithm to find them, namely reverse and add. See this post and this post to view.

See also: https://voodooguru23.blogspot.com/2018/03/the-px1-map.html

Read about Terence Tao's latest discovery: https://t.co/h8cMC9QKes

Tuesday, 1 November 2016

The \(3x+1\) Problem

Today I was struggling to find something of interest to say about the daily number 24684 (see comment at end of this post) and so I considered not just its prime factorisation: \(2^2 \times 3 \times 11^2 \times17\), that consisted only of small primes, but also the factorisation \(4 \times 6171\). I wanted to find out if there was something of interest about the number 6171. It turns out that there is.

OEIS A006877 stated that in the \(3x+1\) problem, these values for the starting value set new records for number of steps to reach 1 and it listed these initial values:
1, 2, 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
But what is the \(3x+1\) problem that's referred to. I'd heard of it but checked on Wikipedia to clarify my understanding. It's referred to there as the Collatz conjecture. Here is the introduction to that Wikipedia article:
The Collatz conjecture is a conjecture in mathematics named after Lothar Collatz. The conjecture is also known as the \(3n + 1\) conjecture, the Ulam conjecture (after Stanisław Ulam), Kakutani's problem (after Shizuo Kakutani), the Thwaites conjecture (after Sir Bryan Thwaites), Hasse's algorithm (after Helmut Hasse), or the Syracuse problem; the sequence of numbers involved is referred to as the hailstone sequence or hailstone numbers (because the values are usually subject to multiple descents and ascents like hailstones in a cloud), or as wondrous numbers.
The conjecture can be summarized as follows. Take any positive integer \(n\). If \(n\) is even, divide it by 2 to get \(n/2\). If n is odd, multiply it by 3 and add 1 to obtain \(3n + 1\). Repeat the process (which has been called "Half Or Triple Plus One", or HOTPO) indefinitely. The conjecture is that no matter what number you start with, you will always eventually reach 1. 
Paul Erdős said about the Collatz conjecture: "Mathematics may not be ready for such problems." He also offered $500 for its solution. Jeffrey Lagarias in 2010 claimed that based only on known information about this problem, "this is an extraordinarily difficult problem, completely out of reach of present day mathematics."
For 6171, 261 steps are required to reach 1. At this stage, nobody has proved the Collatz conjecture. Here are some more records:

The longest progression for any initial starting number

less than 10 is 9, which has 19 steps,
less than 100 is 97, which has 118 steps,
less than 1,000 is 871, which has 178 steps,
less than 10,000 is 6,171, which has 261 steps,
less than 100,000 is 77,031, which has 350 steps,
less than 1 million is 837,799, which has 524 steps,
less than 10 million is 8,400,511, which has 685 steps,
less than 100 million is 63,728,127, which has 949 steps,
less than 1 billion is 670,617,279, which has 986 steps,
less than 10 billion is 9,780,657,631, which has 1132 steps,
less than 100 billion it is 75,128,138,247, which has 1228 steps.

See also:
https://voodooguru23.blogspot.com/2018/03/the-collatz-conjecture-revisited.html

https://voodooguru23.blogspot.com/2018/03/the-px1-map.html

https://t.co/h8cMC9QKes this link relates to Terence Tao's discovery of late 2019.

Comment regarding 24684


In December of 2019, I discovered that by entering a number like 24684 into the Google search box along with the acronym OEIS, a greater range of results will appear compared to just typing the number into the OEIS search bar. The reason for this is that Google will index the text files associated with the sequence. These files typically involve much larger numbers than are displayed for each sequence (possibly the first 1,000 or 10,000 rather than just the first 50).

Using 24684, as an example we find that it is a member of OEIS A228844: smallest sets of 3 consecutive abundant numbers in arithmetic progression. The initial abundant number is listed. However, only the following numbers are listed:
24, 42, 80, 100, 104, 114, 120, 126, 144, 162, 180, 196, 200, 220, 228, 234, 240, 246, 272, 282, 288, 304, 324, 348, 350, 364, 392, 402, 420, 426, 440, 460, 504, 572, 582, 588, 594, 608, 616, 624, 640, 654, 660, 666, 684, 700, 708, 714, 728, 736, 740, 786
The example given in the comments is:
24, 30, 36 is the smallest set of 3 consecutive abundant numbers in arithmetic progression so 24 is in the list.
24684 is nowhere to be found in the previous list but it does turn up in the Google search results as the 1729th member of the sequence. The arithmetic progression is 24684, 24690 and 24696 because all three are abundant with a common difference of 6 between terms.