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.

Showing 1-3 of 3 results.

A123737 Partial sums of (-1)^floor(n*sqrt(2)).

Original entry on oeis.org

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

Views

Author

T. D. Noe, Oct 11 2006

Keywords

Comments

Conjecture: A001652(n) is the index of the first occurrence of n in sequence A123737, A001108(n) is the index of the first occurrence of -n in sequence A123737. - Vaclav Kotesovec, Jun 02 2015

Crossrefs

Cf. A123724 (sum for 2^(1/3)), A123738 (sum for Pi), A123739 (sum for e).

Programs

  • Magma
    [&+[(-1)^Floor(j*Sqrt(2)): j in [1..n]]: n in [1..130]]; // G. C. Greubel, Sep 05 2019
    
  • Maple
    ListTools:-PartialSums([seq((-1)^floor(n*sqrt(2)),n=1..100)]); # Robert Israel, Jun 02 2015
  • Mathematica
    Rest[FoldList[Plus,0,(-1)^Floor[Sqrt[2]*Range[120]]]]
    Accumulate[(-1)^Floor[Range[120]Sqrt[2]]] (* Harvey P. Dale, Jan 16 2012 *)
    (* The positions of the first occurrences of n and -n in this sequence: *) stab = Rest[FoldList[Plus,0,(-1)^Floor[Sqrt[2]*Range[1000000]]]]; Print[Table[FirstPosition[stab,n][[1]],{n,1,8}]]; Print[Table[FirstPosition[stab,-n][[1]],{n,1,8}]]; (* Vaclav Kotesovec, Jun 02 2015 *)
  • PARI
    a(n)=sum(i=1,n,(-1)^sqrtint(2*i^2)) \\ Charles R Greathouse IV, Feb 07 2013
    
  • Sage
    [sum((-1)^floor(j*sqrt(2)) for j in (1..n)) for n in (1..130)] # G. C. Greubel, Sep 05 2019

Formula

O'Bryant, Reznick, & Serbinowska show that |a(n)| <= k log n + 1, with k = 1/(2 log (1 + sqrt(2))), and further -a(n) > k log n + 0.78 infinitely often. - Charles R Greathouse IV, Feb 07 2013

A123724 Partial sums of (-1)^floor(n*2^(1/3)).

Original entry on oeis.org

-1, 0, -1, -2, -1, -2, -1, 0, -1, 0, -1, -2, -1, -2, -1, 0, -1, 0, -1, -2, -1, -2, -1, 0, -1, 0, 1, 0, 1, 0, -1, 0, -1, 0, 1, 0, 1, 0, -1, 0, -1, 0, 1, 0, 1, 0, -1, 0, -1, 0, 1, 0, 1, 2, 1, 2, 1, 0, 1, 0, 1, 2, 1, 2, 1, 0, 1, 0, 1, 2, 1, 2, 1, 0, 1, 0, -1, 0, -1, 0, 1, 0, 1, 0, -1, 0, -1, 0, 1, 0, 1, 0, -1, 0, -1, 0, 1, 0, 1, 0
Offset: 1

Views

Author

T. D. Noe, Oct 11 2006

Keywords

Comments

Remarkably, these partial sums appear to have several periods of length 153008. This sum is not discussed by O'Bryant et al.

Crossrefs

Cf. A123737 (sum for sqrt(2)), A123738 (sum for Pi), A123739 (sum for e).

Programs

  • Mathematica
    Rest[FoldList[Plus,0,(-1)^Floor[2^(1/3)*Range[120]]]]
    Accumulate[(-1)^Floor[Range[100]Surd[2,3]]] (* Harvey P. Dale, Apr 16 2015 *)

A123738 Partial sums of (-1)^floor(n*Pi).

Original entry on oeis.org

-1, 0, -1, 0, -1, 0, -1, -2, -1, -2, -1, -2, -1, -2, -3, -2, -3, -2, -3, -2, -3, -4, -3, -4, -3, -4, -3, -4, -5, -4, -5, -4, -5, -4, -5, -6, -5, -6, -5, -6, -5, -6, -7, -6, -7, -6, -7, -6, -7, -8, -7, -8, -7, -8, -7, -8, -9, -8, -9, -8, -9, -8, -9, -10, -9, -10, -9, -10, -9, -10, -11, -10, -11, -10, -11, -10, -11, -12, -11, -12
Offset: 1

Views

Author

T. D. Noe, Oct 11 2006

Keywords

Crossrefs

Cf. A123724 (sum for 2^(1/3)), A123737 (sum for sqrt(2)), A123739 (sum for e).

Programs

  • Magma
    R:= RealField(20); [&+[(-1)^Floor(j*Pi(R)): j in [1..n]]: n in [1..130]]; // G. C. Greubel, Sep 05 2019
    
  • Mathematica
    Rest[FoldList[Plus,0,(-1)^Floor[Pi*Range[120]]]]
  • PARI
    vector(130, n, sum(j=1,n, (-1)^(j\(1/Pi))) ) \\ G. C. Greubel, Sep 05 2019
    
  • Sage
    [sum((-1)^floor(j*pi) for j in (1..n)) for n in (1..130)] # G. C. Greubel, Sep 05 2019
Showing 1-3 of 3 results.