OFFSET
1,2
COMMENTS
LINKS
EXAMPLE
For n = 7, which corresponds to the Collatz trajectory started from 27, the trajectory reaches larger maximum odd numbers at the following points: 41, 47, 71, 107, 233, 263, 395, 593, 719, 1079, 1619, 2429, 3077. Since there are 14 instances where a new maximum odd number is reached, we have a(7)=14.
PROG
(Python)
def a(num:int) -> int:
count = 0
num = num * 4 - 1
maxnum = num
while num > 1:
if num%2 == 1:
num = num*3 + 1
while num%2 == 0:
num //= 2
if num > maxnum:
count += 1
maxnum = num
return count
CROSSREFS
KEYWORD
nonn
AUTHOR
Chia-Ching Chen, Oct 12 2024
STATUS
approved