OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-1,-1).
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
KEYWORD
easy,sign
AUTHOR
Paul Barry, Oct 27 2004
STATUS
approved