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!)
A194823 a(n) = 2+floor(sum{<((-1)^k)*k*e> : 1<=k<=n}), where < > = fractional part. 4
1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 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, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

LINKS

G. C. Greubel, Table of n, a(n) for n = 1..10000

MATHEMATICA

r = E; p[x_] := FractionalPart[x];

f[n_] := 2 + Floor[Sum[p[k*r] (-1)^k, {k, 1, n}]]

Table[f[n], {n, 1, 1020}]   (* A194823 *)

PROG

(PARI) for(n=1, 50, print1(2 + floor(sum(k=1, n, (-1)^k*frac(k*exp(1))), ", ")) \\ G. C. Greubel, Apr 02 2018

(Magma) [2 + Floor((&+[(-1)^k*(k*Exp(1) - Floor(k*Exp(1))) :k in [1..n]])) : n in [1..50]]; // G. C. Greubel, Apr 02 2018

CROSSREFS

Cf. A194821, A194822, A194824.

Sequence in context: A233544 A026535 A080462 * A098396 A297773 A043532

Adjacent sequences:  A194820 A194821 A194822 * A194824 A194825 A194826

KEYWORD

nonn

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 October 4 04:26 EDT 2022. Contains 357237 sequences. (Running on oeis4.)