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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A194824 a(n) = 2+floor(sum{<((-1)^k)*k*sqrt(3)> : 1<=k<=n}), where < > = fractional part. 4
1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 1, 2, 1, 2, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 3, 3, 3, 3, 3, 2, 3, 2, 3, 2, 2, 2, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 3, 3, 3, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
The first negative term is a(5431) = -1. - Georg Fischer, Feb 15 2019
LINKS
MATHEMATICA
r = Sqrt[3]; p[x_] := FractionalPart[x];
f[n_] := 2 + Floor[Sum[p[k*r] (-1)^k, {k, 1, n}]]
Table[f[n], {n, 1, 1000}] (* A194824 *)
PROG
(PARI) for(n=1, 50, print1(2 + floor(sum(k=1, n, (-1)^k*frac(k*sqrt(3))), ", ")) \\ G. C. Greubel, Apr 02 2018
(Magma) [2 + Floor((&+[(-1)^k*(k*Sqrt(3) - Floor(k*Sqrt(3))) :k in [1..n]])) : n in [1..50]]; // G. C. Greubel, Apr 02 2018
CROSSREFS
Sequence in context: A283876 A365663 A067754 * A339931 A339221 A025851
KEYWORD
sign
AUTHOR
Clark Kimberling, Sep 03 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | 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 August 25 17:34 EDT 2024. Contains 375442 sequences. (Running on oeis4.)