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 A075997 #37 Jun 14 2025 09:50:29 %S A075997 0,0,1,0,2,1,2,1,4,2,3,2,5,4,5,2,6,5,6,5,8,5,6,5,10,8,9,6,9,8,9,8,13, %T A075997 10,11,8,12,11,12,9,14,13,14,13,16,11,12,11,18,16,17,14,17,16,17,14, %U A075997 19,16,17,16,21,20,21,16,22,19,20,19,22,19,20,19,26,25,26,21,24,21,22,21 %N A075997 a(n) = [n/2] - [n/3] + [n/4] - [n/5] + [n/6] - ..., where [n/k] = floor(n/k). %C A075997 a(n) is the number of terms among {floor(n/k)}, 1<=k<=n, which are even. - _Leroy Quet_, Jan 19 2006 %H A075997 Vaclav Kotesovec, <a href="/A075997/b075997.txt">Table of n, a(n) for n = 0..2000</a> %F A075997 a(n) = n - A059851(n). %F A075997 a(n) = n - A006218(n) + 2*A006218(floor(n/2)). - _Vladeta Jovovic_, Oct 02 2002 %F A075997 a(n) = n - Sum_{n/2<k<=n} d(k) + Sum_{1<=k<=n/2} d(k), where d(k) = A000005(k). - _Leroy Quet_, Jan 19 2006 %F A075997 G.f.: ( Sum_{i>0} x^(2*i)/(1+x^i) )/(1-x). - _Vladeta Jovovic_, Apr 24 2006 %F A075997 a(n) = Sum_{i=1..n} floor(n/(2*i)) - floor((n-i)/(2*i)). - _Wesley Ivan Hurt_, Jan 30 2016 %F A075997 Conjecture: Let f(a,b)=1, if (a+b) mod |a-b| != (a mod |a-b|)+(b mod |a-b|), and 0 otherwise. a(n) = Sum_{k=1..n-1} f(n+k,n-k). - _Benedict W. J. Irwin_, Sep 23 2016 %F A075997 a(n) = Sum_{k=1..n} (floor((n-i)/i) mod 2 ). - _Wesley Ivan Hurt_, Dec 20 2020 %F A075997 a(n) ~ (1 - log(2))*n. - _Vaclav Kotesovec_, Jun 14 2025 %e A075997 a(6) = [6/2]-[6/3]+[6/4]-[6/5]+[6/6]-[6/7]+... = 3-2+1-1+1-0+... = 2. %p A075997 A075997:=n->add(floor(n/(2*i))-floor((n-i)/(2*i)), i=1..n): seq(A075997(n), n=0..100); # _Wesley Ivan Hurt_, Jan 30 2016 %t A075997 Table[Sum[Floor[n/(2 i)] - Floor[(n - i)/(2 i)], {i, n}], {n, 0, 100}] (* _Wesley Ivan Hurt_, Jan 30 2016 *) %o A075997 (PARI) a(n) = sum(k=2, n, (-1)^k*(n\k)); \\ _Michel Marcus_, Dec 20 2020 %o A075997 (Python) %o A075997 from math import isqrt %o A075997 def A075997(n): return n+(s:=isqrt(n))**2-((t:=isqrt(m:=n>>1))**2<<1)-(sum(n//k for k in range(1,s+1))-(sum(m//k for k in range(1,t+1))<<1)<<1) # _Chai Wah Wu_, Oct 23 2023 %Y A075997 Cf. A000005, A006218, A060831, A059851. %K A075997 nonn,easy %O A075997 0,5 %A A075997 _Clark Kimberling_, Sep 28 2002