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 A102722 #21 Oct 25 2023 09:30:35 %S A102722 0,0,0,0,1,0,2,1,2,2,4,2,4,4,4,4,6,4,7,5,6,7,9,6,8,9,10,8,11,8,11,10, %T A102722 11,13,14,10,13,14,15,13,16,13,17,16,15,17,20,16,18,17,19,18,22,20,21, %U A102722 19,20,22,26,19,23,25,24,23,25,23,26,26,28,26,30,23,27,29,29,29,31,29,33 %N A102722 Given n, sum all division remainders {n/k}, with k=1,...,n. The value a(n) is given by the floor of that sum. Note that {x}:=x-[x]. %C A102722 Conjecture: a(n) ~ (1-EulerGamma)n. %H A102722 Robert Israel, <a href="/A102722/b102722.txt">Table of n, a(n) for n = 1..10000</a> %F A102722 a(n) = floor(n*H(n)) - Sum_{j=1..n} d(j), where d(n)=A000005(n) is the number of divisors of n, and H(n) is the n-th Harmonic Number. [_Enrique Pérez Herrero_, Aug 25 2009; corrected by _Robert Israel_, Mar 20 2016] %F A102722 a(n) = A052488(n) - A006218(n). [_Enrique Pérez Herrero_, Aug 25 2009] %e A102722 a(5) = [{5/1}+{5/2}+{5/3}+{5/4}+{5/5}]=[0+0.5+0.6666+0.25+0]=[1.4166]=1 (division by 1 or by the number itself is to be avoided). %p A102722 N:= 100: %p A102722 H:= ListTools:-PartialSums([seq(1/n,n=1..N)]): %p A102722 S:= ListTools:-PartialSums(map(numtheory:-tau,[$1..N])): %p A102722 seq(floor(n*H[n])-S[n],n=1..N); # _Robert Israel_, Mar 20 2016 %t A102722 Resto = Function[n, Sum[n/k - Floor[n/k], {k, 2, n - 1}]]; Floor[Map[Resto, Range[1, 1000]]] %t A102722 Table[Floor[n*HarmonicNumber[n]] - Sum[DivisorSigma[0, k], {k, 1, n}], {n, 1, 200}] (* _Enrique Pérez Herrero_, Aug 25 2009 *) %t A102722 Table[Floor[Sum[FractionalPart[n/k], {k, 1, n}]], {n, 1, 200}] (* _Enrique Pérez Herrero_, Aug 25 2009 *) %o A102722 (Python) %o A102722 from math import isqrt %o A102722 from sympy import harmonic %o A102722 def A102722(n): return int(n*harmonic(n))+(s:=isqrt(n))**2-(sum(n//k for k in range(1,s+1))<<1) # _Chai Wah Wu_, Oct 24 2023 %Y A102722 Cf. A052488, A006218. %Y A102722 Cf. A000005. %K A102722 easy,nonn %O A102722 1,7 %A A102722 _Carlos Alves_, Feb 06 2005