A099838 Expansion of (1-x)^2*(1+x)/(1+x+x^2).
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
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (-1,-1).
Programs
-
Magma
[1,-2] cat [3*(n+1 -3*Floor((n+2)/3)): n in [2..110]]; // G. C. Greubel, Apr 21 2023
-
Mathematica
LinearRecurrence[{-1,-1}, {1,-2,0,3}, 100] (* Jean-François Alcover, Jan 02 2022 *)
-
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
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