This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A348295 #39 May 27 2025 06:22:38 %S A348295 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, %T A348295 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, %U A348295 4,5,6,5,4,5,6,5,4,3,4,5,4,3,2,3,4,3,2,3,4,5,4 %N A348295 a(n) = Sum_{k=1..n} (-1)^(floor(k*(sqrt(2)-1))). %C A348295 Problem B6 of the 81st William Powell Putnam Mathematical Competition (2020) asks to show that a(n) >= 0 for all n. %C A348295 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. %C A348295 (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. %H A348295 Jianing Song, <a href="/A348295/b348295.txt">Table of n, a(n) for n = 0..10000</a> %H A348295 Mathematical Association of America, <a href="https://web.archive.org/web/20240315212022/https://www.maa.org/sites/default/files/pdf/Putnam/2020/2020Putnam_final.pdf">The 81st William Lowell Putnam Mathematical Competition Problems</a> %H A348295 Mathematical Association of America, <a href="https://web.archive.org/web/20230328121632/https://www.maa.org/sites/default/files/pdf/Putnam/2020/2020%20Putnam%20Session%20B%20Solutions.pdf">The 81st William Lowell Putnam Mathematical Competition Session B Solutions</a> %H A348295 <a href="/index/O#Olympiads">Index to sequences related to Olympiads and other Mathematical competitions</a>. %F A348295 a(n) = Sum_{k=1..n} (-1)^A097508(k). %e A348295 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. %t A348295 a[n_] := Sum[(-1)^Floor[k*(Sqrt[2] - 1)], {k, 1, n}]; Array[a, 100, 0] (* _Amiram Eldar_, Oct 11 2021 *) %o A348295 (PARI) a(n) = sum(k=1, n, (-1)^(sqrtint(2*k^2)-k)) %o A348295 (Python) %o A348295 from math import isqrt %o A348295 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 %Y A348295 Cf. A097508, A084068, A348299, A000129, A001333. %K A348295 nonn %O A348295 0,3 %A A348295 _Jianing Song_, Oct 10 2021