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.

A117909 Count, inserting 0 after every even number.

Original entry on oeis.org

1, 2, 0, 3, 4, 0, 5, 6, 0, 7, 8, 0, 9, 10, 0, 11, 12, 0, 13, 14, 0, 15, 16, 0, 17, 18, 0, 19, 20, 0, 21, 22, 0, 23, 24, 0, 25, 26, 0, 27, 28, 0, 29, 30, 0, 31, 32, 0, 33, 34, 0, 35, 36, 0, 37, 38, 0, 39, 40, 0, 41, 42, 0, 43, 44, 0, 45, 46, 0, 47, 48, 0, 49, 50, 0, 51, 52, 0, 53, 54, 0
Offset: 0

Views

Author

Paul Barry, Apr 01 2006

Keywords

Comments

Row sums of A117908.

Crossrefs

Programs

  • Magma
    I:=[1,2,0,3,4,0]; [n le 6 select I[n] else 2*Self(n-3) - Self(n-6): n in [1..91]]; // G. C. Greubel, Oct 21 2021
    
  • Mathematica
    Riffle[Range[60],0,3] (* Harvey P. Dale, Sep 12 2013 *)
  • Sage
    def a(n): return (2*n+3)/3 if (n%3==0) else 2*(n+2)/3 if (n%3==1) else 0
    [a(n) for n in (0..90)] # G. C. Greubel, Oct 21 2021

Formula

G.f.: (1 +2*x +x^3)/(1-x^3)^2.
a(n) = Sum_{k=0..n} 0^abs(L(C(n,2)/3) - 2*L(C(k,2)/3)) where L(j/p) is the Legendre symbol of j and p.
a(n) = sin((n+1)*Pi/3)*((8*n+14)*sin((n+1)*Pi/3) - sqrt(3)*cos(n*Pi))/9. - Wesley Ivan Hurt, Sep 24 2017