* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Digit Characteristics in the Collatz 3n+1 Iterations
Survey
Document related concepts
History of logarithms wikipedia , lookup
Ethnomathematics wikipedia , lookup
Positional notation wikipedia , lookup
List of prime numbers wikipedia , lookup
Mathematics of radio engineering wikipedia , lookup
Infinitesimal wikipedia , lookup
Location arithmetic wikipedia , lookup
Georg Cantor's first set theory article wikipedia , lookup
Quadratic reciprocity wikipedia , lookup
Bernoulli number wikipedia , lookup
Law of large numbers wikipedia , lookup
Hyperreal number wikipedia , lookup
Real number wikipedia , lookup
Large numbers wikipedia , lookup
Proofs of Fermat's little theorem wikipedia , lookup
Transcript
Digit Characteristics in the Collatz 3n+1 Iterations Subhash Kak September 24, 2014 Abstract: The trajectory of the 3n+1 problem is generated when an odd number n is replaced by 3n+1 and even number is halved in an iterative manner leading ultimately to 1. Some new properties of these sequences are presented. In particular, it is shown that numbers that are equal to 1 modulo 4 iteratively converge to 1 although we do not specify the number of steps needed. It is shown that for the numbers tested, the proportion of prime numbers in the sequences is quite high. Introduction The 3n+1 problem is associated with many names that generally begin with L. Collatz (1937) and includes other mathematicians [1]-[4]. According to this problem, take any natural number 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 and repeat the process indefinitely. The conjecture is that no matter what number one starts with, one will eventually reach 1. Formally, the mapping is the function s: N → N on the set of positive integers: n/2 s ( n) 3n 1 if n is even (1) if n is odd Let s 0 (n) n and s k (n) s(s k 1 (n)) for k N . This will generate the orbit of n. If n = 7, one gets the sequence 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1; in other words, the orbit or trajectory of 7 has 17 elements and the path length is 16. The maximum value generated is 52. The trajectory of n = 3 is 3, 10, 5, 16, 8, 4, 2, 1, that is it has 8 elements in it or it has a path length of 7, with a maximum value of 16. The Collatz sequence for n = 25, takes 23 steps, climbing to 88 before descending to 1: ( 25, 76, 38, 19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1 ). The algorithm for the sequence can also be written so that it excludes even numbers, but we shall not do so in this paper. The questions that interest the computer scientist are: the characteristics of the numbers in the orbit, the path length, the largest number encountered in the path, and the proportion of numbers that is prime. From the perspective of cryptography, one is also interested in the randomness characteristics of the numbers in the path either directly or when the sequence is reduced to a binary sequence by replacing the even numbers by -1 and odd numbers by +1 (that is equivalent to considering the numbers mod 2). Our expectation is that the randomness characteristics [5],[6] of the sequence will be excellent due to the complexity of the iteration graph. We like to point out the related question of randomness in physical systems [7]-[9] that may also be attributed to complexity. By way of contrast we can look at d-sequences where for the expansion 1/p for prime p, the binary sequence a(n) is given by the formula [10]-[11] a(n) 2n mod p mod 2 . In contrast to the successive multiplication by 2 in the d-sequence, we have successive multiplication by 3 (together with addition of number 1 and reduction of even numbers) for the Collatz sequence. 1 The d-sequence thus does not appear to have the same “information content” as the Collatz sequence. Two other number theoretic random sequences are related to the generation of Pythagorean triples [12] and the divisor pairs function [13]. The difficulty of establishing the Collatz conjecture is due to the “random” nature of its graph [14] (Figure 1) The Collatz map can also be viewed as a dynamical system and various generalizations of this map have been analyzed [15]. 17 53 96 1024 52 160 48 512 26 80 24 256 13 40 12 128 20 6 64 10 3 32 5 9 336 28 168 85 84 42 21 16 8 4 2 1 Figure 1. A portion of Collatz mapping as a directed graph In this paper we summarize some general properties of the Collatz sequence. In particular, we present results on odd counts and iterative convergence. Path length, odd count, and primes We first summarize in Tables 1 and 2 characteristics of Collatz sequences with respect to the maximum value and the longest path for n < 1000. Table 1. Sequence of maximum values up to n < 1,000 n Path length Odd count Max value 1 0 0 1 2 1 1 2 3 7 3 16 7 16 6 52 15 17 6 160 27 111 42 9,232 255 47 16 13,120 447 97 35 39,364 639 131 48 41,524 703 170 63 250,504 2 As we can see, the path length does not grow quickly as n increases and the maximum value increases much faster than the path length. Table 2. Sequence of longest paths up to n < 1,000 n Path length Odd count Max value 1 0 0 1 2 1 1 2 3 7 3 16 6 8 3 16 7 16 6 52 9 19 7 52 18 20 7 52 25 23 8 88 27 111 42 9,232 54 112 42 9,232 73 115 43 9,232 97 118 44 9,232 129 121 45 9,232 171 124 46 9,232 231 127 47 9,232 313 130 48 9,232 327 143 53 9,232 649 144 53 9,232 703 170 63 250,504 871 178 66 190,996 In Table 2 the sequences are listed according to the largest path length. It is striking that the maximum value for many of these sequences is the same: two sequences have value 16, three have 52, and ten have value 9,232. It is clear that sequences with the same maximum number are related. We now provide results on the number of primes with respect to n in Table 3. Table 3. Sequence of most primes up to n < 10,000 n Path length Odd count Prime count 1 0 0 0 2 1 1 1 3 7 3 3 7 16 6 6 19 19 7 7 27 111 42 25 97 118 44 26 231 127 47 29 487 142 52 30 1153 151 55 31 1407 172 63 32 1,895 175 64 35 2,539 178 65 36 4,011 189 69 37 6,171 262 97 43 3 A large proportion (56%) of the odd numbers in the range 1 ≤ n ≤ 10,000 is prime. This suggests that the Collatz sequence can be used to generate numbers that have a high probability of being prime. General properties of Collatz sequences First note that one need only consider odd numbers in the transformation as the even numbers are divided successively by 2 until reduced to an odd number. If the number is n mod 4 1, then n = 4k+1. Upon use of (1), the next number is n 3(4k 1) 1 12k 4. When reduced further, it becomes n 3k 1 . If k is odd, n is even and upon further reduction it may lead to numbers that are congruent to either 1 or 3 modulo 4. If k is even, the n values are alternately 3 and 1 modulo 4. This means that if one can show that n mod 4 1 numbers converge, so will the n mod 4 3 numbers. Lemma. If an odd number a leads to another odd number (after several applications of the Collatz transformation) b, then 4a+1 also leads to b. Proof. The odd number a will go to 3a+1, whereas the number 4a+1will go to 12a + 4 which when reduced will also equal 3a+1. As example, 3 goes through 10 to 5; so will 13, 53, 213, 853, 3,413, 13,653, .. go to 5 after passing through intermediate even numbers. If one were ready to skip intermediate odd numbers, then one can consider the general linear transformation on a that takes it to ca+d. So long as this number is odd, it will be transformed further by (1) that we will put equal to some product of the original transformed number 3a+1. This means: 3ca 3d 1 (3a 1) (2) Here α is a suitable constant. This, in turn, gives the conditions: 3ca 3a and 3d 1 (3) In other words, c 3d 1. By taking different values of d=1, 2, 3, 4, 5, … we can generate maps between different starting numbers that lead to the same terminal odd number. The transformations, thus, will be: 4a+1 7a+2 10a+3 13a+4 4 …. and so on. If a takes the value 1, then the numbers 5, 9, 13, 17, … will belong to the same class. This is the class of numbers n mod 4 1, and all these numbers will eventually reach 1 since we know elements of this class for which this is true. This argument does not tell us what the length of the path for any specific number will be. Other classes are 13, 23, 33, 43, … when a=3, and 21, 37, 53, 69, … for a=5, and so on. The only other odd numbers that one needs to account for are those for which n mod 4 3. But we have already seen that in their evolution they alternate with n mod 4 1 numbers. Probabilistically, there is probability ½ that the next number will be of the type n mod 4 1. In other words, at the end of a string of k-1 odd numbers of type n mod 4 3 there is the probability 2 k that the next number is of type n mod 4 1 and the string will converge. Summarizing, Theorem 1. All numbers n mod 4 1 iterate to 1 although the path length cannot be specified. Numbers n mod 4 3 iterate to 1 with probability equal to 1 2 k where k is the count of such numbers in the string. Proportion of odd numbers For a large set of random odd numbers k, k/2 are divisible of 2 and not by powers of 2, k/4 are divisible by 4 and not by powers of 4, k/8 are divisible by 8 and not by powers of 8, and so on. The numbers that are divisible by 2 and not by its powers return to an odd number right away by the halving process of (1). Those that are divisible by 4 and not by powers of 4 return in 2 steps, and those that are divisible by 8 and not its powers return in 3 steps, and so on. Therefore, for k odd numbers, the number of corresponding even numbers is: k 2k 3k 4k 5k (4) S ... 2 4 8 16 32 Multiplying (4) by ½ and subtracting from itself, we get: S k k k k ... 2 2 4 8 16 (5) It follows that the count of even numbers is 2k. Theorem 2. The count of odd numbers in a large path Collatz sequence is approximately one-half the count of even numbers. Conclusion This paper has presented several properties of Collatz sequences. In particular, it is shown that numbers that are equal to 1 modulo 4 iteratively converge to 1 although we do not specify the number of steps needed. Numbers that are equal to 3 modulo 4 iterate to 1 with probability equal to 1 2 k where k is the count of such numbers in the string being 5 considered. It is shown that for the numbers tested, the proportion of prime numbers in the sequences is quite high. References 1. L.E. Garner, On the Collatz 3n + 1 algorithm. Proceedings of the American Mathematical Society 82 (1): 19–22 (1981) 2. B. Hayes, On the ups and downs of hailstone numbers. Scientific American, January 1984. 3. S. Andrei and C. Masalagiu, About the Collatz conjecture. Acta Informatica 35: 167179 (1998) 4. J.P. Van Bendegem, The Collatz conjecture: A case study in mathematical problem solving. Logic and Logical Philosophy 14: 7–23 (2005) 5. A Kolmogorov, Three approaches to the quantitative definition of information. Problems of Information Transmission. 1:1-17 (1965) 6. S. Kak, Classification of random binary sequences using Walsh-Fourier analysis. IEEE Trans. on Electromagnetic Compatibility, EMC-13: 74-77 (1971) 7. S Kak, Information, physics and computation. Found. of Phys. 26: 127-137 (1996) 8. R. Landauer, The physical nature of information. Physics Letters A 217: 188-193 (1996) 9. S Kak, Quantum information and entropy. Int. Journal of Theo. Phys. 46: 860-876 (2007) 10. S. Kak and A. Chatterjee, On decimal sequences. IEEE Trans. on Information Theory IT-27: 647 – 652 (1981) 11. S. Kak, Encryption and error-correction coding using D sequences. IEEE Trans. on Computers C-34: 803-809 (1985) 12. S. Kak and M. Prabhu, Cryptography applications of primitive Pythagorean triples. Cryptologia 38: 215-222 (2014) 13. S. Kak, Random sequences based on the divisor pairs function. arXiv:1210.4614 (2012) 14. J.C. Lagarias, The 3x + 1 problem and its generalization. Amer. Math. Monthly, 92(1): 3-23 (1985) 15. G.J. Wirsching, The Dynamical System Generated by the 3n+1 Function. Lecture Notes in Mathematics 1681. Springer-Verlag (1998) 6