login
A100219
Expansion of (1-2*x)/((1-x)*(1-x+x^2)).
8
1, 0, -2, -3, -2, 0, 1, 0, -2, -3, -2, 0, 1, 0, -2, -3, -2, 0, 1, 0, -2, -3, -2, 0, 1, 0, -2, -3, -2, 0, 1, 0, -2, -3, -2, 0, 1, 0, -2, -3, -2, 0, 1, 0, -2, -3, -2, 0, 1, 0, -2, -3, -2, 0, 1, 0, -2, -3, -2, 0, 1, 0, -2, -3, -2, 0, 1, 0, -2, -3, -2, 0
OFFSET
0,3
COMMENTS
Row sums of number triangle A100218.
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
Sequence in context: A019509 A071484 A372706 * A079757 A071493 A289813
KEYWORD
easy,sign
AUTHOR
Paul Barry, Nov 08 2004
STATUS
approved