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.

A123739 Partial sums of (-1)^floor(n*e).

Original entry on oeis.org

1, 0, 1, 2, 1, 2, 1, 0, 1, 0, -1, 0, -1, 0, 1, 0, 1, 2, 1, 2, 1, 0, 1, 0, -1, 0, -1, 0, 1, 0, 1, 2, 1, 2, 1, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 1, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 1, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 1, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 1
Offset: 1

Views

Author

T. D. Noe, Oct 11 2006

Keywords

Crossrefs

Cf. A123724 (sum for 2^(1/3)), A123737 (sum for sqrt(2)), A123738 (sum for pi).

Programs

  • Magma
    [&+[(-1)^Floor(j*Exp(1)): j in [1..n]]: n in [1..130]]; // G. C. Greubel, Sep 05 2019
    
  • Mathematica
    Rest[FoldList[Plus,0,(-1)^Floor[E*Range[120]]]]
    Accumulate[(-1)^Floor[E Range[200]]] (* Harvey P. Dale, May 06 2022 *)
  • PARI
    vector(50, n, sum(j=1,n, (-1)^(j\exp(-1))) ) \\ G. C. Greubel, Sep 05 2019
    
  • Sage
    [sum((-1)^floor(j*exp(1)) for j in (1..n)) for n in (1..130)] # G. C. Greubel, Sep 05 2019