%I #17 Aug 05 2022 07:45:39
%S 0,2,1,28,2,126,2,344,2,730,3,1332,3,2198,3,3376,4,4914,4,6860,4,9262,
%T 4,12168,4,15626,5,19684,5,24390,5,29792,5,35938,5,42876,6,50654,6,
%U 59320,6,68922,6,79508,6,91126,6,103824,6,117650,7,132652,7,148878,7
%N Image of n under the x^3+1 map, which is a variation of the 3x+1 (Collatz) map.
%C 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, ...
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Collatz_conjecture">Collatz conjecture</a>
%F a(n) = floor(sqrt(n)) if n is even, n^3+1 if n is odd.
%e For n = 2, a(2) = floor(sqrt(2)) = 1, because 2 is even.
%e For n = 5, a(5) = 3^5+1 = 126, because 5 is odd.
%o (Python)
%o from math import floor, sqrt
%o def a(n): return n**3 + 1 if n % 2 else int(floor(sqrt(n)))
%o print([a(n) for n in range(101)])
%o (Python)
%o from math import isqrt
%o def A336911(n): return n**3+1 if n&1 else isqrt(n) # _Chai Wah Wu_, Aug 04 2022
%Y Cf. A006370 (image of n under the 3x+1 map).
%Y Cf. A336912 (gives number of steps to reach 1).
%K nonn
%O 0,2
%A _Robert C. Lyons_, Aug 07 2020
|