%I #24 Dec 12 2023 07:45:18
%S 5,13,33,83,208,104,52,26,13,33,83,208,104,52,26,13,33,83,208,104,52,
%T 26,13,33,83,208,104,52,26,13,33,83,208,104,52,26,13,33,83,208,104,52,
%U 26,13,33,83,208,104,52,26,13,33,83,208,104,52,26,13,33,83,208,104,52,26,13,33,83,208,104,52,26,13,33,83,208,104,52
%N Trajectory of 5 under repeated application of the map in A185452.
%C Periodic with period length 7.
%D J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see page 88.
%H Colin Barker, <a href="/A185454/b185454.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>
%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,1).
%F From _Colin Barker_, Feb 01 2018: (Start)
%F G.f.: x*(5 + 13*x + 33*x^2 + 83*x^3 + 208*x^4 + 104*x^5 + 52*x^6 + 21*x^7) / ((1 - x)*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)).
%F a(n) = a(n-7) for n>8. (End)
%p f:=n->if n mod 2 = 0 then n/2 else (5*n+1)/2; fi;
%p T:=proc(n,M) global f; local t1,i; t1:=[n];
%p for i from 1 to M-1 do t1:=[op(t1),f(t1[nops(t1)])]; od: t1; end;
%p T(5,120);
%o (PARI) Vec(x*(5 + 13*x + 33*x^2 + 83*x^3 + 208*x^4 + 104*x^5 + 52*x^6 + 21*x^7) / ((1 - x)*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)) + O(x^60)) \\ _Colin Barker_, Feb 01 2018
%Y Cf. A185452, A185453, A185455.
%K nonn,easy
%O 1,1
%A _N. J. A. Sloane_, Feb 04 2011
%E Comment corrected by _Paolo P. Lava_, Mar 10 2011