OFFSET
1,3
COMMENTS
The x^3+1 map, which is a variation of the 3x+1 (Collatz) map, is defined for x >= 0 as follows: if x is odd, then map x to x^3+1; otherwise, map x to floor(sqrt(x)).
It seems that all x^3+1 trajectories reach 1; this has been verified up to 10^10.
LINKS
Wikipedia, Collatz conjecture
EXAMPLE
For n = 3, a(3) = 9, because there are 9 steps from 3 to 1 in the following trajectory for 3: 3, 28, 5, 126, 11, 1332, 36, 6, 2, 1.
For n = 4, a(4) = 2, because there are 2 steps from 4 to 1 in the following trajectory for 4: 4, 2, 1.
PROG
(Python)
from math import floor, sqrt
def a(n):
if n == 1: return 0
count = 0
while True:
if (n % 2) == 0: n = int(floor(sqrt(n)))
else: n = n**3 + 1
count += 1
if n == 1: break
return count
print([a(n) for n in range(1, 101)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert C. Lyons, Aug 07 2020
STATUS
approved