This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A246007 #18 Oct 20 2019 22:04:05 %S A246007 2,5,3,6,7,7,19,5,4,11,7,15,10,9,14,17,12,8,21,20,16,15,11,33,36,36, %T A246007 18,10,14,31,26,22,21,13,26,34,16,12,21,42,25,16,16,37,20,29,19,24,32, %U A246007 90,28,28,19,19,85,23,40,14,36,27,22,49,17,31,31,40,13,44,43,26,66,43,25,25,25,30,21,30,30,51,20,25,25,33,47,16,47,91,46,46,29,46,28 %N A246007 Length of pseudo-Collatz cycles '3*n - 1' of prime numbers. %C A246007 Define a pseudo-Collatz cycle C(prime(n)) = {c(z+1) = c(z)/2 if c(z) mod 2 = 0, otherwise c(z+1) = 3*c(z) - 1}, z >= 1, c(1) = prime(n), n >= 1} depending of the starting point c(1). If c(1) = prime(n) then c(z) might be %C A246007 (1) finite convergent to c(z) = 1 or %C A246007 (2) infinite periodic from c(z) = 7 or from c(z) = 17 or %C A246007 (3) no cycle if c(z) = -1. %C A246007 The case (3) is not observed out of 10^5 prime numbers. So a(n) = z is the length of the C(prime(n)) up to the stoppping point, where c(z) = 1 or up to the periodical point, where c(z) = 7 or c(z) = 17 or c(z) = c(1). See Table for examples of cases (1) and (2). The longest sequence here is a(99147) = 560 with starting point c(1) = prime(99147) = 1287511 up to the periodical point c(560) = 17. %H A246007 Freimut Marschner, <a href="/A246007/b246007.txt">Table of n, a(n) for n = 1..100000</a> %F A246007 a(n) = z where {c(z+1) = c(z)/2 if c(z) mod 2 = 0, otherwise c(z+1) = 3*c(z) - 1}, z >= 1, c(1) = prime(n), n>= 1}. %e A246007 a(1) = {c(1) = prime(1) = 2, 2 mod 2 = 0, c(2) = 2/2 = 1, z=2} = 2. %e A246007 Table for cases (1) and (2): %e A246007 case (1) %e A246007 c(1) = prime(2) = 3 %e A246007 z 1 2 3 4 5 %e A246007 c(z) 3 8 4 2 1 %e A246007 a(2) = 5 %e A246007 c(1) = prime(3) = 5 %e A246007 z 1 2 3 %e A246007 c(z) 5 14 7 %e A246007 a(3) = 3 %e A246007 c(1) = prime(10) = 29 %e A246007 z 1 2 3 4 5 6 7 8 9 10 11 %e A246007 c(z) 29 86 43 128 64 32 16 8 4 2 1 %e A246007 a(10) = 11 %e A246007 case (2) %e A246007 c(1) = prime(4) = 7 %e A246007 z 1 2 3 4 5 6 7 ... %e A246007 c(z) 7 20 10 5 14 7 20 ... %e A246007 a(4) = 6 %e A246007 c(1) = prime(7) = 17 %e A246007 z 1 2 3 4 5 6 7 8 9 10 11 12 13 %e A246007 c(z) 17 50 25 74 37 110 55 164 82 41 122 61 182 %e A246007 z 14 15 16 17 18 19 20 ... %e A246007 c(z) 91 272 136 68 34 17 50 ... %e A246007 a(7) = 19 %Y A246007 A003627 (Primes of form 3n-1), A006370 (Image of n under the '3x+1' map), A014682 (The Collatz or 3x+1 function: a(n) = n/2 if n is even, otherwise (3n+1)/2), A006577(Number of halving and tripling steps to reach 1 in '3x+1' problem), A016789({3n+2, n >=0} = {3n-1, n >= 1}). %K A246007 nonn %O A246007 1,1 %A A246007 _Freimut Marschner_, Aug 10 2014