OFFSET
0,2
COMMENTS
It seems that all x^3+1 trajectories reach 1; this has been verified up to 10^10. Once a x^3+1 trajectory reaches 1, it repeats the following cycle: 1, 2, 1, 2, 1, ...
LINKS
Wikipedia, Collatz conjecture
FORMULA
a(n) = floor(sqrt(n)) if n is even, n^3+1 if n is odd.
EXAMPLE
For n = 2, a(2) = floor(sqrt(2)) = 1, because 2 is even.
For n = 5, a(5) = 3^5+1 = 126, because 5 is odd.
PROG
(Python)
from math import floor, sqrt
def a(n): return n**3 + 1 if n % 2 else int(floor(sqrt(n)))
print([a(n) for n in range(101)])
(Python)
from math import isqrt
def A336911(n): return n**3+1 if n&1 else isqrt(n) # Chai Wah Wu, Aug 04 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert C. Lyons, Aug 07 2020
STATUS
approved