%I #51 Aug 12 2021 05:05:53
%S 8,12,18,27,20,30,45,34,51,38,57,43,32,48,72,108,162,243,182,273,205,
%T 154,231,173,130,195,146,219,164,246,369,277,208,312,468,702,1053,790,
%U 1185,889,667,500,750,1125,844,1266,1899,1424,2136,3204,4806,7209,5407
%N Iterate the map in A006368 starting at 8.
%C It is conjectured that this trajectory never repeats, but no proof of this has been found. - _N. J. A. Sloane_, Jul 14 2009
%D J. H. Conway, Unpredictable iterations, in Proc. Number Theory Conf., Boulder, CO, 1972, pp. 49-52. - _N. J. A. Sloane_, Oct 04 2012
%D R. K. Guy, Unsolved Problems in Number Theory, E17. - _N. J. A. Sloane_, Oct 04 2012
%D J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see page 5. [From _N. J. A. Sloane_, Jan 21 2011]
%H Markus Sigg, <a href="/A028393/b028393.txt">Table of n, a(n) for n = 0..9999</a> (terms 0..1000 from T. D. Noe)
%H J. H. Conway, <a href="http://www.jstor.org/stable/10.4169/amer.math.monthly.120.03.192">On unsettleable arithmetical problems</a>, Amer. Math. Monthly, 120 (2013), 192-198.
%H D. Gale, <a href="http://dx.doi.org/10.1007/978-1-4612-2192-0">Tracking the Automatic Ant And Other Mathematical Explorations</a>, A Collection of Mathematical Entertainments Columns from The Mathematical Intelligencer, Springer, 1998; see p. 16. [From _N. J. A. Sloane_, Jul 14 2009]
%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%F a(n+1) = A006368(a(n)).
%p F := proc(n) option remember; if n = 0 then 8 elif 3*F(n-1) mod 2 = 0 then 3*F(n-1)/2 else round(3*F(n-1)/4); fi; end; [ seq(F(i),i=0..80) ];
%t f[n_?EvenQ] := 3*n/2; f[n_] := Round[3*n/4]; a[0] = 8; a[n_] := a[n] = f[a[n - 1]]; Table[a[n], {n, 0, 52}] (* _Jean-François Alcover_, Jun 10 2013 *)
%o (Haskell)
%o a028393 n = a028393_list !! n
%o a028393_list = iterate a006368 8 -- _Reinhard Zumkeller_, Apr 18 2012
%o (Python)
%o from functools import lru_cache
%o @lru_cache(maxsize=None)
%o def F(n):
%o if n == 0: return 8
%o elif 3*F(n-1)%2 == 0: return 3*F(n-1)//2
%o else: return (3*F(n-1)+1)//4
%o print([F(i) for i in range(81)]) # _Michael S. Branicky_, Aug 12 2021 after _J. H. Conway_
%Y Cf. A006368, A028394, A180864.
%Y Cf. A028395, A180853, A182205; A028398(4) = 8.
%Y Trajectories under A006368 and A006369: A180853, A217218, A185590, A180864, A028393, A028394, A094328, A094329, A028396, A028395, A217729, A182205, A223083-A223088, A185589, A185590.
%K nonn,look
%O 0,1
%A _J. H. Conway_