

A365048


a(n) is the number of steps required for the nth 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 + (P1)/2; otherwise the next number = largest prime <= (P+1)/2.


2



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, 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, 12, 6, 12, 6, 17, 6, 14, 6, 17, 14, 14, 11, 11, 14, 14, 14, 8, 11, 11, 14, 11, 8, 11, 16
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

Conjecture: This hailstone operation on odd prime numbers will always reach 3.
If the condition "(P + (P1)/2)" is changed to "(P + (P+1)/2)" then some prime numbers will go into a loop. For example, 449 will loop through 2609.
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,....


LINKS



EXAMPLE

Case 3: 0 steps required.
Case 5: 2 steps required: 5,7,3.
Case 7: 1 step required: 7,3.
Case 11: 6 steps required: 11,17,29,43,19,7,3.
case 17: 5 steps required: 17,29,43,19,7,3.


MATHEMATICA

A365048[n_]:=Length[NestWhileList[If[Divisible[#+1, 6], NextPrime[#+(#1)/21], NextPrime[(#+1)/2+1, 1]]&, Prime[n+1], #>3&]]1; Array[A365048, 100] (* Paolo Xausa, Nov 13 2023 *)


PROG

(Python)
from sympy import nextprime, prevprime
def hailstone(prime):
if (prime + 1) % 6 == 0:
jump = prime + ((prime  1) / 2)
jump = nextprime(jump  1)
else:
jump = ((prime + 1) / 2)
jump = prevprime(jump + 1)
return jump
q = 2
lst = []
while q < 3000:
count = 0
p = nextprime(q)
q = p
while p != 3:
p = hailstone(p)
count = count + 1
lst.append(count)


CROSSREFS



KEYWORD

nonn


AUTHOR



STATUS

approved



