login
A099838
Expansion of (1-x)^2*(1+x)/(1+x+x^2).
8
1, -2, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0, 3, -3, 0
OFFSET
0,2
FORMULA
a(n) = Sum_{k=0..n} (-1)^k*( cos(2*Pi*(n-k)/3) + sin(2*Pi*(n-k)/3)/sqrt(3) )*C(2, k).
a(n) = 2*sqrt(3)*cos((4*n+1)*Pi/6) for n>=2. - Richard Choulet, Apr 23 2009
a(n) = 3*A049347(n) - 2*[n=0] + [n=1]. - G. C. Greubel, Apr 21 2023
MATHEMATICA
LinearRecurrence[{-1, -1}, {1, -2, 0, 3}, 100] (* Jean-François Alcover, Jan 02 2022 *)
PROG
(Magma) [1, -2] cat [3*(n+1 -3*Floor((n+2)/3)): n in [2..110]]; // G. C. Greubel, Apr 21 2023
(SageMath) [3*(n+1) -9*((n+2)//3) -2*int(n==0) +int(n==1) for n in range(111)] # G. C. Greubel, Apr 21 2023
CROSSREFS
Partial sums are A099837.
Cf. A049347.
Sequence in context: A258817 A004557 A088276 * A369280 A127449 A328911
KEYWORD
easy,sign
AUTHOR
Paul Barry, Oct 27 2004
STATUS
approved