OFFSET
1,1
COMMENTS
The first negative term is a(1291) = -1. - Georg Fischer, Feb 15 2019
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
MATHEMATICA
r = GoldenRatio; p[x_] := FractionalPart[x];
f[n_] := 3 + Floor[Sum[p[k*r] (-1)^k, {k, 1, n}]]
Table[f[n], {n, 1, 100}] (* A194822 *)
PROG
(PARI) a(n) = 3 + floor(sum(k=1, n, (-1)^k*frac(k*(1+sqrt(5))/2))) \\ G. C. Greubel, Apr 02 2018
(Magma) [3 + Floor((&+[(-1)^k*(k*(1+Sqrt(5))/2 - Floor(k*(1+Sqrt(5))/2)) :k in [1..n]])) : n in [1..50]]; // G. C. Greubel, Apr 02 2018
CROSSREFS
KEYWORD
sign
AUTHOR
Clark Kimberling, Sep 03 2011
EXTENSIONS
Definition corrected by Georg Fischer, Jul 31 2023
STATUS
approved