login
A167380
a(1)=1, a(2)=2, and continued periodically with 4, 5, 1, -4, -5, -1 .
3
1, 2, 4, 5, 1, -4, -5, -1, 4, 5, 1, -4, -5, -1, 4, 5, 1, -4, -5, -1, 4, 5, 1, -4, -5, -1, 4, 5, 1, -4, -5, -1, 4, 5, 1, -4, -5, -1, 4, 5, 1, -4, -5, -1, 4, 5, 1, -4, -5, -1, 4, 5, 1, -4, -5, -1, 4, 5, 1, -4, -5, -1, 4, 5, 1, -4, -5, -1, 4, 5, 1, -4, -5, -1, 4, 5, 1, -4, -5, -1, 4, 5, 1, -4, -5
OFFSET
1,2
FORMULA
a(1)=1. a(2)=2. a(6k-3)=4. a(6k-2)=5. a(6k-1)=1. a(6k)=-4. a(6k+1)=-5. a(6k+2)=-1.
From R. J. Mathar, Nov 03 2009: (Start)
a(n) = a(n-1) - a(n-2), n > 4.
G.f.: x*(1+x)*(3*x^2+1)/(1-x+x^2). (End)
MAPLE
A167380 := proc(n) if n <= 2 then n; else op(1+ (n mod 6), [-4, -5, -1, 4, 5, 1]) ; end if; end proc: seq(A167380(n), n=1..120) ; # R. J. Mathar, Nov 02 2009
MATHEMATICA
PadRight[{1, 2}, 120, {-5, -1, 4, 5, 1, -4}] (* or *) Join[{1, 2}, LinearRecurrence[ {1, -1}, {4, 5}, 120]] (* Harvey P. Dale, Mar 08 2015 *)
CROSSREFS
Sequence in context: A225153 A360108 A308319 * A242613 A196548 A359720
KEYWORD
sign,easy
AUTHOR
Jamel Ghanouchi, Nov 02 2009
EXTENSIONS
Unrelated material removed, and values corrected according to definition, by R. J. Mathar, Nov 05 2009
STATUS
approved