login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

The sequence {1, 2, 3, 4, 5, 4, 3, 2} repeated.
1

%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