login
A140318
Period 18: repeat 0, 1, -1, 1, 0, -1, 1, -1, 0, 0, -1, 1, -1, 0, 1, -1, 1, 0.
0
0, 1, -1, 1, 0, -1, 1, -1, 0, 0, -1, 1, -1, 0, 1, -1, 1, 0, 0, 1, -1, 1, 0, -1, 1, -1, 0, 0, -1, 1, -1, 0, 1, -1, 1, 0, 0, 1, -1, 1, 0, -1, 1, -1, 0, 0, -1, 1, -1, 0, 1, -1, 1, 0, 0, 1, -1, 1, 0, -1, 1, -1, 0, 0, -1, 1, -1, 0, 1, -1, 1, 0, 0, 1, -1, 1, 0, -1, 1, -1, 0, 0, -1, 1, -1, 0
OFFSET
0,1
FORMULA
O.g.f.: (1-x)(x^2+1)x/(1-x^3+x^6). a(n)=a(n-3)-a(n-6). - R. J. Mathar, Jun 12 2008
MATHEMATICA
PadRight[{}, 18*5, {0, 1, -1, 1, 0, -1, 1, -1, 0, 0, -1, 1, -1, 0, 1, -1, 1, 0}] (* Harvey P. Dale, Dec 11 2011 *)
PROG
(PARI) a(n)=[0, 1, -1, 1, 0, -1, 1, -1, 0][n%9+1]*(-1)^(n\9%2) \\ Charles R Greathouse IV, Jul 13 2016
CROSSREFS
Sequence in context: A285972 A275510 A286055 * A060584 A098725 A284939
KEYWORD
sign,easy
AUTHOR
Paul Curtz, May 26 2008
STATUS
approved