%I #52 Dec 14 2023 05:33:22
%S 1,-1,1,0,0,0,1,-1,1,0,0,0,1,-1,1,0,0,0,1,-1,1,0,0,0,1,-1,1,0,0,0,1,
%T -1,1,0,0,0,1,-1,1,0,0,0,1,-1,1,0,0,0,1,-1,1,0,0,0,1,-1,1,0,0,0,1,-1,
%U 1,0,0,0,1,-1,1,0,0,0,1,-1,1,0,0,0,1,-1,1
%N Period 6: repeat [1,-1,1,0,0,0].
%C Diagonal sums of number triangle A115359.
%C The partial sum operator applied twice gives A001399. - _Gregory L. Simay_, Sep 30 2017
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (-1,0,1,1).
%F G.f.: 1/(1 + x - x^3 - x^4) = 1/( (1+x)*(1-x)*(1+x+x^2)).
%F a(n) = -a(n-1) + a(n-3) + a(n-4), n > 3.
%F a(n) = cos(2*Pi*n/3)/3 - sin(2*Pi*n/3)/sqrt(3) + cos(Pi*n)/2 + 1/6.
%F a(n) = Sum_{k=0..floor(n/2)} if(n-k=k, 1, 0) OR if(n-k=2k+1, -1, 0).
%F a(n) = (1/2)*((-1)^n + i^(4-2*(n mod 3))), where i=sqrt(-1). - _Bruno Berselli_, Oct 31 2012
%F a(n) = (floor(n/6) - floor((n-3)/6))*(-1)^n. - _Wesley Ivan Hurt_, Sep 08 2015
%F |a(n)-a(n-1)| = A164965(n). a(n)+a(n-1) = A079978(n). - _R. J. Mathar_, Aug 11 2021
%F a(n) = sign((n-4) mod 3) - sign((n-4) mod 2). - _Wesley Ivan Hurt_, Feb 04 2022
%t LinearRecurrence[{-1, 0, 1, 1}, {1, -1, 1, 0}, 100] (* _Vincenzo Librandi_, Sep 09 2015 *)
%o (Magma) &cat[[1,-1,1,0,0,0]: n in [0..15]]; // _Vincenzo Librandi_, Sep 09 2015
%Y Cf. A001399, A115359.
%K sign,easy
%O 0,1
%A _Paul Barry_, Jan 21 2006