login
A128615
Expansion of x/(1 + x + x^2 - x^3 - x^4 - x^5).
1
0, 1, -1, 0, 2, -2, 0, 3, -3, 0, 4, -4, 0, 5, -5, 0, 6, -6, 0, 7, -7, 0, 8, -8, 0, 9, -9, 0, 10, -10, 0, 11, -11, 0, 12, -12, 0, 13, -13, 0, 14, -14, 0, 15, -15, 0, 16, -16, 0, 17, -17, 0, 18, -18, 0, 19, -19
OFFSET
0,5
COMMENTS
Partial sums are 0,1,0,0,2,0,0,3,0,0,4,...
FORMULA
G.f.: x/((1-x)*(1+x+x^2)^2) = x*(1-x)/(1-x^3)^2.
a(n) = (1/9)*(1 - cos(2*Pi*n/3) + sqrt(3)*(2*n + 3)*sin(2*Pi*n/3)).
a(n) = floor((n+3)/3)*A049347(n+2). - G. C. Greubel, Mar 26 2024
MATHEMATICA
CoefficientList[Series[x/(1+x+x^2-x^3-x^4-x^5), {x, 0, 60}], x] (* or *) LinearRecurrence[{-1, -1, 1, 1, 1}, {0, 1, -1, 0, 2}, 60] (* or *) Table[{0, n, -n}, {n, 20}]//Flatten (* Harvey P. Dale, Jul 15 2017 *)
Table[Floor[(n+3)/3]*(Mod[n+1, 3] -1), {n, 0, 40}] (* G. C. Greubel, Mar 26 2024 *)
PROG
(Magma) [Floor((n+3)/3)*((n+1) mod 3 -1): n in [0..40]]; // G. C. Greubel, Mar 26 2024
(SageMath) [((n+3)//3)*((n+1)%3 -1) for n in range(41)] # G. C. Greubel, Mar 26 2024
CROSSREFS
Sequence in context: A341445 A360048 A127899 * A087508 A095731 A048142
KEYWORD
easy,sign
AUTHOR
Paul Barry, Mar 13 2007
STATUS
approved