login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


A194821
a(n) = 1+floor(sum{<((-1)^k)*k*sqrt(2)> : 1<=k<=n}), where < > = fractional part.
4
0, 1, 1, 1, 1, 2, 1, 1, 0, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 1, 2, 1, 2, 2, 2, 2, 3, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 0, 1, 0, 1, 1, 1, 1, 2, 1, 1, 0, 1, 0, 1, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 1, 2, 1, 2, 2, 2, 2, 3, 3
OFFSET
1,6
COMMENTS
Does 0 occur infinitely many times? Is the sequence unbounded?
LINKS
MATHEMATICA
r = Sqrt[2]; p[x_] := FractionalPart[x];
f[n_] := 1 + Floor[Sum[p[k*r] (-1)^k, {k, 1, n}]]
Table[f[n], {n, 1, 100}] (* A194821 *)
PROG
(PARI) for(n=1, 50, print1(1 + floor(sum(k=1, n, (-1)^k*frac(k*sqrt(2))), ", ")) \\ G. C. Greubel, Apr 02 2018
(Magma) [1 + Floor((&+[(-1)^k*(k*Sqrt(2) - Floor(k*Sqrt(2))) :k in [1..n]])) : n in [1..50]]; // G. C. Greubel, Apr 02 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Sep 03 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 24 10:38 EDT 2024. Contains 376196 sequences. (Running on oeis4.)