OFFSET
0,1
LINKS
Muniru A Asiru, Table of n, a(n) for n = 0..2000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,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
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Oct 03 2007
STATUS
approved