OFFSET
0,1
COMMENTS
Diagonal sums of number triangle A115359.
The partial sum operator applied twice gives A001399. - Gregory L. Simay, Sep 30 2017
LINKS
Index entries for linear recurrences with constant coefficients, signature (-1,0,1,1).
FORMULA
G.f.: 1/(1 + x - x^3 - x^4) = 1/( (1+x)*(1-x)*(1+x+x^2)).
a(n) = -a(n-1) + a(n-3) + a(n-4), n > 3.
a(n) = cos(2*Pi*n/3)/3 - sin(2*Pi*n/3)/sqrt(3) + cos(Pi*n)/2 + 1/6.
a(n) = Sum_{k=0..floor(n/2)} if(n-k=k, 1, 0) OR if(n-k=2k+1, -1, 0).
a(n) = (1/2)*((-1)^n + i^(4-2*(n mod 3))), where i=sqrt(-1). - Bruno Berselli, Oct 31 2012
a(n) = (floor(n/6) - floor((n-3)/6))*(-1)^n. - Wesley Ivan Hurt, Sep 08 2015
a(n) = sign((n-4) mod 3) - sign((n-4) mod 2). - Wesley Ivan Hurt, Feb 04 2022
MATHEMATICA
LinearRecurrence[{-1, 0, 1, 1}, {1, -1, 1, 0}, 100] (* Vincenzo Librandi, Sep 09 2015 *)
PROG
(Magma) &cat[[1, -1, 1, 0, 0, 0]: n in [0..15]]; // Vincenzo Librandi, Sep 09 2015
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Paul Barry, Jan 21 2006
STATUS
approved