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.

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

Original entry on oeis.org

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

Views

Author

Paul Barry, Oct 27 2004

Keywords

Crossrefs

Partial sums are A099837.
Cf. A049347.

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