login
A181975
The sequence {1, 2, 3, 4, 5, 4, 3, 2} repeated.
1
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,2
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
Cf. A131974.
Sequence in context: A017880 A086144 A131974 * A062406 A271800 A073792
KEYWORD
nonn,easy
AUTHOR
Steven Sund, Apr 04 2012
STATUS
approved