OFFSET
1,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,0,-1,1).
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
MATHEMATICA
PadRight[{}, 120, {1, 2, 3, 4, 5, 4, 3, 2}] (* Harvey P. Dale, Oct 20 2015 *)
PROG
(PARI) a(n)=abs((n+3)%8-4)+1 \\ Charles R Greathouse IV, Apr 04 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Steven Sund, Apr 04 2012
STATUS
approved