%I #22 Mar 28 2024 13:17:25
%S 1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1,2,
%T 3,4,5,4,3,2,1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1,2,3,4,5,4,3,2,1,2,3,4,
%U 5,4,3,2,1,2,3,4,5,4,3,2,1,2,3,4,5,4,3
%N The sequence {1, 2, 3, 4, 5, 4, 3, 2} repeated.
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,-1,1).
%F a(n) = abs(mod((n+3),8)-4)+1.
%F G.f.: (2+x+x^2+x^3+x^4)/((1-x)*(1+x^4)). - _Charles R Greathouse IV_, Apr 04 2012
%t PadRight[{},120,{1,2,3,4,5,4,3,2}] (* _Harvey P. Dale_, Oct 20 2015 *)
%o (PARI) a(n)=abs((n+3)%8-4)+1 \\ _Charles R Greathouse IV_, Apr 04 2012
%Y Cf. A131974.
%K nonn,easy
%O 1,2
%A _Steven Sund_, Apr 04 2012
|