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!)
A348295 a(n) = Sum_{k=1..n} (-1)^(floor(k*(sqrt(2)-1))). 3
0, 1, 2, 1, 0, 1, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 1, 0, 1, 2, 1, 0, 1, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6, 5, 4, 5, 6, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
Problem B6 of the 81st William Powell Putnam Mathematical Competition (2020) asks to show that a(n) >= 0 for all n.
Conjecture: (1) Sequence is unbounded from above. Moreover, it seems that the earliest occurrence of m is A000129(m) for even m and A001333(m) for odd m (this has been confirmed for m <= 32 by Chai Wah Wu, Oct 21 2021). See A084068 for the conjectured indices of records.
(2) There are infinitely many 0's in the sequence. See A348299 for indices of 0. Since |a(n+1) - a(n)| = 1, (1)(2) together imply that this sequence hits every natural number infinitely many times.
LINKS
FORMULA
a(n) = Sum_{k=1..n} (-1)^A097508(k).
EXAMPLE
A097508(1)..A097508(10) = [0, 0, 1, 1, 2, 2, 2, 3, 3, 4], so a(10) = 1+1-1-1+1+1+1-1-1+1 = 2.
MATHEMATICA
a[n_] := Sum[(-1)^Floor[k*(Sqrt[2] - 1)], {k, 1, n}]; Array[a, 100, 0] (* Amiram Eldar, Oct 11 2021 *)
PROG
(PARI) a(n) = sum(k=1, n, (-1)^(sqrtint(2*k^2)-k))
(Python)
from math import isqrt
def A348295(n): return sum(-1 if (isqrt(2*k*k)-k) % 2 else 1 for k in range(1, n+1)) # Chai Wah Wu, Oct 12 2021
CROSSREFS
Sequence in context: A307672 A037834 A212496 * A362598 A179765 A004074
KEYWORD
nonn
AUTHOR
Jianing Song, Oct 10 2021
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 May 2 16:57 EDT 2024. Contains 372198 sequences. (Running on oeis4.)