login
A131670
Period 5: repeat [1, 0, -1, 0, 1].
1
1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0, -1, 0, 1, 1, 0
OFFSET
0,1
FORMULA
G.f.: ( -1+x^2-x^4 ) / ( (x-1)*(1+x+x^2+x^3+x^4) ). - R. J. Mathar, Apr 02 2011
a(n) = (2/5)*(1/2 + cos(4*(n-4)*Pi/5) - cos(2*(n-2)*Pi/5) - cos(4*(n-2)*Pi/5) + cos(2*n*Pi/5) + cos(4*n*Pi/5) + cos(2*(n+1)*Pi/5)). - Wesley Ivan Hurt, Sep 26 2018
MAPLE
seq(op([1, 0, -1, 0, 1]), n=1..30); # Muniru A Asiru, Sep 29 2018
MATHEMATICA
PadRight[{}, 120, {1, 0, -1, 0, 1}] (* Harvey P. Dale, May 22 2012 *)
PROG
(PARI) a(n)=abs(n%5-2)-1 \\ Jaume Oliver Lafont, Aug 28 2009
(GAP) Flat(List([1..30], n->[1, 0, -1, 0, 1])); # Muniru A Asiru, Sep 29 2018
(Magma) &cat[[1, 0, -1, 0, 1]^^20]; // Vincenzo Librandi, Oct 02 2018
CROSSREFS
Sequence in context: A341150 A244220 A283963 * A188044 A287523 A288932
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Oct 03 2007
STATUS
approved