A181975 The sequence {1, 2, 3, 4, 5, 4, 3, 2} repeated.
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, 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, 5, 4, 3, 2, 1, 2, 3, 4, 5, 4, 3, 2, 1, 2, 3, 4, 5, 4, 3
Offset: 1
Links
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,-1,1).
Crossrefs
Cf. A131974.
Programs
-
Mathematica
PadRight[{},120,{1,2,3,4,5,4,3,2}] (* Harvey P. Dale, Oct 20 2015 *)
-
PARI
a(n)=abs((n+3)%8-4)+1 \\ Charles R Greathouse IV, Apr 04 2012
Formula
a(n) = abs(mod((n+3),8)-4)+1.
G.f.: (2+x+x^2+x^3+x^4)/((1-x)*(1+x^4)). - Charles R Greathouse IV, Apr 04 2012