OFFSET
0,3
COMMENTS
Row sums of number triangle A100218.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (2,-2,1).
FORMULA
a(n) = 2*a(n-1) - 2*a(n-2) + a(n-3).
a(n) = cos(Pi*n/3 + Pi/3) + sqrt(3)*sin(Pi*n/3 + Pi/3) - 1.
a(n) is the n-th order Taylor polynomial (centered at 0) of 1/c(x)^n evaluated at x = 1, where c(x) = (1 - sqrt(1 - 4*x))/(2*x) is the o.g.f. of the Catalan numbers A000108. - Peter Bala, Apr 20 2024
MATHEMATICA
PadRight[{}, 120, {1, 0, -2, -3, -2, 0}] (* or *) LinearRecurrence[{2, -2, 1}, {1, 0, -2}, 50] (* G. C. Greubel, Mar 13 2017; Mar 28 2024 *)
Table[Cos[Pi*n/3 + Pi/3] + Sqrt[3]*Sin[Pi*n/3 + Pi/3] - 1, {n, 0, 71}] (* Indranil Ghosh, Mar 13 2017 *)
PROG
(PARI) my(x='x+O('x^50)); Vec((1-2*x)/((1-x)*(1-x+x^2))) \\ G. C. Greubel, Mar 13 2017
(Magma) &cat[[1, 0, -2, -3, -2, 0]: n in [0..20]]; // G. C. Greubel, Mar 28 2024
(SageMath)
def A100219(n): return [1, 0, -2, -3, -2, 0][n%6]
[A100219(n) for n in range(121)] # G. C. Greubel, Mar 28 2024
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Paul Barry, Nov 08 2004
STATUS
approved