cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A100219 Expansion of (1-2*x)/((1-x)*(1-x+x^2)).

Original entry on oeis.org

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

Views

Author

Paul Barry, Nov 08 2004

Keywords

Comments

Row sums of number triangle A100218.

Crossrefs

Programs

  • Magma
    &cat[[1,0,-2,-3,-2,0]: n in [0..20]]; // G. C. Greubel, Mar 28 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 *)
  • PARI
    my(x='x+O('x^50)); Vec((1-2*x)/((1-x)*(1-x+x^2))) \\ G. C. Greubel, Mar 13 2017
    
  • 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

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