OFFSET
1,6
COMMENTS
Does 0 occur infinitely many times? Is the sequence unbounded?
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
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) a(n) = 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