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
Jianing Song, Table of n, a(n) for n = 0..10000
Mathematical Association of America, The 81st William Lowell Putnam Mathematical Competition Problems
Mathematical Association of America, The 81st William Lowell Putnam Mathematical Competition Session B Solutions
FORMULA
a(n) = Sum_{k=1..n} (-1)^A097508(k).
EXAMPLE
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
KEYWORD
nonn
AUTHOR
Jianing Song, Oct 10 2021
STATUS
approved