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!)
A194821 a(n) = 1+floor(sum{<((-1)^k)*k*sqrt(2)> : 1<=k<=n}), where < > = fractional part. 4

%I #11 Sep 08 2022 08:45:58

%S 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,

%T 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,

%U 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

%N a(n) = 1+floor(sum{<((-1)^k)*k*sqrt(2)> : 1<=k<=n}), where < > = fractional part.

%C Does 0 occur infinitely many times? Is the sequence unbounded?

%H G. C. Greubel, <a href="/A194821/b194821.txt">Table of n, a(n) for n = 1..10000</a>

%t r = Sqrt[2]; p[x_] := FractionalPart[x];

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

%t Table[f[n], {n, 1, 100}] (* A194821 *)

%o (PARI) for(n=1,50, print1(1 + floor(sum(k=1,n, (-1)^k*frac(k*sqrt(2))), ", ")) \\ _G. C. Greubel_, Apr 02 2018

%o (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

%Y Cf. A194822, A194823, A194824.

%K nonn

%O 1,6

%A _Clark Kimberling_, Sep 03 2011

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 April 18 02:22 EDT 2024. Contains 371767 sequences. (Running on oeis4.)