OFFSET
0,1
COMMENTS
Differences of the period 6: repeat [1, 5, 4, 6, 2, 3] (A070365).
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,1).
FORMULA
From Wesley Ivan Hurt, Jun 23 2016: (Start)
G.f.: (4-x+2*x^2-4*x^3+x^4+2*x^5)/(1-x^6).
a(n) = a(n-6) for n>5.
a(n) = (2 + 5*cos(n*Pi) + 7*cos(n*Pi/3) - 2*cos(2*n*Pi/3) - sqrt(3)*sin(n*Pi/3) - 2*sqrt(3)*sin(2*n*Pi/3))/3. (End)
MAPLE
A178141:=n->[4, -1, 2, -4, 1, 2][(n mod 6)+1]: seq(A178141(n), n=0..100); # Wesley Ivan Hurt, Jun 23 2016
MATHEMATICA
PadRight[{}, 100, {4, -1, 2, -4, 1, 2}] (* Wesley Ivan Hurt, Jun 23 2016 *)
PROG
(PARI) a(n)=[1, 5, 4, 6, 2, 3][n%5+1] \\ Charles R Greathouse IV, Jun 02 2011
(Magma) &cat [[4, -1, 2, -4, 1, 2]^^20]; // Wesley Ivan Hurt, Jun 23 2016
CROSSREFS
KEYWORD
sign,easy,less
AUTHOR
Paul Curtz, May 21 2010
EXTENSIONS
New name from Wesley Ivan Hurt, Jun 23 2016
STATUS
approved