%I #31 Dec 14 2023 05:10:36
%S 4,5,7,9,6,4,5,7,9,6,4,5,7,9,6,4,5,7,9,6,4,5,7,9,6,4,5,7,9,6,4,5,7,9,
%T 6,4,5,7,9,6,4,5,7,9,6,4,5,7,9,6,4,5,7,9,6,4,5,7,9,6,4,5,7,9,6,4,5,7,
%U 9,6,4,5,7,9,6,4,5,7,9,6,4,5,7,9,6,4,5,7,9,6,4,5,7,9,6,4,5,7,9,6,4,5,7,9,6
%N Iterate the map in A006369 starting at 4.
%D J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see page 270.
%H Reinhard Zumkeller, <a href="/A094328/b094328.txt">Table of n, a(n) for n = 1..10000</a>
%H J. C. Lagarias, <a href="http://www.cecm.sfu.ca/organics/papers/lagarias/paper/html/paper.html">The 3x+1 problem and its generalizations</a>, Amer. Math. Monthly, 92 (1985), 3-23.
%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (0, 0, 0, 0, 1).
%F The map is: n -> if n mod 3 = 0 then 2*n/3 elif n mod 3 = 1 then (4*n-1)/3 else (4*n+1)/3.
%F Periodic with period length 5.
%t Table[{4, 5, 7, 9, 6}, {21}] // Flatten (* _Jean-François Alcover_, Jun 10 2013 *)
%t LinearRecurrence[{0, 0, 0, 0, 1},{4, 5, 7, 9, 6},105] (* _Ray Chandler_, Sep 03 2015 *)
%o (Haskell)
%o a094328 n = a094328_list !! (n-1)
%o a094328_list = iterate a006369 4 -- _Reinhard Zumkeller_, Dec 31 2011
%o (PARI) a(n)=([0,1,0,0,0; 0,0,1,0,0; 0,0,0,1,0; 0,0,0,0,1; 1,0,0,0,0]^(n-1)*[4;5;7;9;6])[1,1] \\ _Charles R Greathouse IV_, Oct 18 2022
%Y Cf. A006368, A028394-A028397, A094329, A185589, A185590.
%K nonn,easy
%O 1,1
%A _N. J. A. Sloane_, Jun 04 2004