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 A365048 #36 Nov 13 2023 17:54:34 %S A365048 0,2,1,6,2,5,2,4,4,3,3,5,3,8,5,13,4,4,7,4,4,6,12,9,6,9,6,6,14,5,8,11, %T A365048 5,8,5,5,5,16,13,13,13,13,10,7,10,10,7,15,15,15,12,15,15,12,12,12,9,6, %U A365048 12,6,12,6,17,6,14,6,17,14,14,11,11,14,14,14,8,11,11,14,11,8,11,16 %N A365048 a(n) is the number of steps required for the n-th odd prime number to reach 3 when iterating the following hailstone map: If P+1 == 0 (mod 6), then the next number = smallest prime >= P + (P-1)/2; otherwise the next number = largest prime <= (P+1)/2. %C A365048 Conjecture: This hailstone operation on odd prime numbers will always reach 3. %C A365048 If the condition "(P + (P-1)/2)" is changed to "(P + (P+1)/2)" then some prime numbers will go into a loop. For example, 449 will loop through 2609. %C A365048 If the condition "(P+1)/2" is changed to "(P+3)/2" then some prime numbers will go into a loop. For example, 5 will go into the loop 5,7,5,7,.... %H A365048 Paolo Xausa, <a href="/A365048/b365048.txt">Table of n, a(n) for n = 1..10000</a> %e A365048 Case 3: 0 steps required. %e A365048 Case 5: 2 steps required: 5,7,3. %e A365048 Case 7: 1 step required: 7,3. %e A365048 Case 11: 6 steps required: 11,17,29,43,19,7,3. %e A365048 case 17: 5 steps required: 17,29,43,19,7,3. %t A365048 A365048[n_]:=Length[NestWhileList[If[Divisible[#+1,6],NextPrime[#+(#-1)/2-1],NextPrime[(#+1)/2+1,-1]]&,Prime[n+1],#>3&]]-1;Array[A365048,100] (* _Paolo Xausa_, Nov 13 2023 *) %o A365048 (Python) %o A365048 from sympy import nextprime, prevprime %o A365048 def hailstone(prime): %o A365048 if (prime + 1) % 6 == 0: %o A365048 jump = prime + ((prime - 1) / 2) %o A365048 jump = nextprime(jump - 1) %o A365048 else: %o A365048 jump = ((prime + 1) / 2) %o A365048 jump = prevprime(jump + 1) %o A365048 return jump %o A365048 q = 2 %o A365048 lst = [] %o A365048 while q < 3000: %o A365048 count = 0 %o A365048 p = nextprime(q) %o A365048 q = p %o A365048 while p != 3: %o A365048 p = hailstone(p) %o A365048 count = count + 1 %o A365048 lst.append(count) %Y A365048 Cf. A007528, A065091 (odd primes). %K A365048 nonn %O A365048 1,2 %A A365048 _Najeem Ziauddin_, Oct 21 2023