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.

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

This page as a plain text file.
%I A123737 #35 Mar 24 2025 12:53:58
%S A123737 -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,
%T A123737 -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,
%U A123737 -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
%N A123737 Partial sums of (-1)^floor(n*sqrt(2)).
%C A123737 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
%H A123737 T. D. Noe, <a href="/A123737/b123737.txt">Table of n, a(n) for n = 1..10000</a>
%H A123737 Henk Bruin and Robbert Fokkink, <a href="https://arxiv.org/abs/2503.11734">On the records and zeros of a deterministic random walk</a>, arXiv:2503.11734 [math.DS], 2025. See p. 2.
%H A123737 Kevin O'Bryant, Bruce Reznick and Monika Serbinowska, <a href="https://arxiv.org/abs/math/0308087">Almost alternating sums</a>, arXiv:math/0308087 [math.NT], 2003-2205; Amer. Math. Monthly, Vol. 113 (October 2006), pp. 673-688.
%F A123737 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
%p A123737 ListTools:-PartialSums([seq((-1)^floor(n*sqrt(2)),n=1..100)]); # _Robert Israel_, Jun 02 2015
%t A123737 Rest[FoldList[Plus,0,(-1)^Floor[Sqrt[2]*Range[120]]]]
%t A123737 Accumulate[(-1)^Floor[Range[120]Sqrt[2]]] (* _Harvey P. Dale_, Jan 16 2012 *)
%t A123737 (* 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 *)
%o A123737 (PARI) a(n)=sum(i=1,n,(-1)^sqrtint(2*i^2)) \\ _Charles R Greathouse IV_, Feb 07 2013
%o A123737 (Magma) [&+[(-1)^Floor(j*Sqrt(2)): j in [1..n]]: n in [1..130]]; // _G. C. Greubel_, Sep 05 2019
%o A123737 (Sage) [sum((-1)^floor(j*sqrt(2)) for j in (1..n)) for n in (1..130)] # _G. C. Greubel_, Sep 05 2019
%Y A123737 Cf. A123724 (sum for 2^(1/3)), A123738 (sum for Pi), A123739 (sum for e).
%Y A123737 Cf. A001652, A001951, A228639.
%K A123737 easy,sign
%O A123737 1,8
%A A123737 _T. D. Noe_, Oct 11 2006