login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A178141
Period 6: repeat [4, -1, 2, -4, 1, 2].
2
4, -1, 2, -4, 1, 2, 4, -1, 2, -4, 1, 2, 4, -1, 2, -4, 1, 2, 4, -1, 2, -4, 1, 2, 4, -1, 2, -4, 1, 2, 4, -1, 2, -4, 1, 2, 4, -1, 2, -4, 1, 2, 4, -1, 2, -4, 1, 2, 4, -1, 2, -4, 1, 2, 4, -1, 2, -4, 1, 2, 4, -1, 2, -4, 1, 2, 4, -1, 2, -4, 1, 2, 4, -1, 2, -4, 1, 2
OFFSET
0,1
COMMENTS
Differences of the period 6: repeat [1, 5, 4, 6, 2, 3] (A070365).
FORMULA
Mix A153727(n+1) with -A153727(n).
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