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 A236632 #44 Oct 23 2023 10:29:48 %S A236632 0,1,3,7,11,19,25,36,46,60,70,92,104,124,144,170,186,219,237,273,301, %T A236632 333,355,407,435,473,509,559,587,651,681,738,782,832,876,958,994,1050, %U A236632 1102,1184,1224,1312,1354,1432,1504,1572,1618,1732,1786,1873,1941 %N A236632 Sum of all divisors of all positive integers <= n minus the total number of divisors of all positive integers <= n. %H A236632 Robert Israel, <a href="/A236632/b236632.txt">Table of n, a(n) for n = 1..10000</a> %F A236632 a(n) = A024916(n) - A006218(n). %F A236632 a(n) = (1/2) * Sum_{i=1..n} floor(n/i) * floor((n-i)/i). - _Wesley Ivan Hurt_, Jan 30 2016 %F A236632 a(n) = Sum_{i=1..n} binomial(floor(n/i),2). - _Wesley Ivan Hurt_, May 08 2016 %F A236632 a(n) = Sum_{k=1..n} (k-1) * floor(n/k). - _Wesley Ivan Hurt_, Apr 02 2017 %F A236632 a(n) = (1/2)*(A222548(n) - A006218(n)). - _Ridouane Oudra_, Aug 01 2019 %e A236632 For n = 6 the sets of divisors of the positive integers <= 6 are {1}, {1, 2}, {1, 3}, {1, 2, 4}, {1, 5}, {1, 2, 3, 6}. There are 14 total divisors and their sum is 1 + 3 + 4 + 7 + 6 + 12 = 33, so a(6) = 33 - 14 = 19. %p A236632 A236632:=n->(1/2)*add(floor(n/i)*floor((n-i)/i), i=1..n): seq(A236632(n), n=1..100); # _Wesley Ivan Hurt_, Jan 30 2016 %p A236632 N:= 1000: # to get a(1) to a(N) %p A236632 A065608:= Vector(N): %p A236632 for a from 1 to floor(sqrt(N)) do for b from a to N/a do %p A236632 if b = a then %p A236632 A065608[a*b] := A065608[a*b] + a - 1 %p A236632 else %p A236632 A065608[a*b] := A065608[a*b] + a + b - 2; %p A236632 fi %p A236632 od od: %p A236632 ListTools:-PartialSums(convert(A065608,list)); # _Robert Israel_, May 16 2016 %t A236632 Table[Sum[Floor[n/i]*Floor[(n - i)/i], {i, n}]/2, {n, 50}] (* _Wesley Ivan Hurt_, Jan 30 2016 *) %t A236632 Table[Sum[Binomial[Floor[n/i], 2], {i, n}], {n, 51}] (* _Michael De Vlieger_, May 15 2016 *) %t A236632 Accumulate@ Table[DivisorSum[n, # - 1 &], {n, 51}] (* or *) %t A236632 Table[Sum [(k - 1) Floor[n/k], {k, n}], {n, 51}] (* _Michael De Vlieger_, Apr 03 2017 *) %o A236632 (PARI) a(n) = sum(i=1, n, sigma(i)) - sum(i=1, n, numdiv(i)); \\ _Michel Marcus_, Feb 01 2014 %o A236632 (Magma) [(&+[DivisorSigma(1, k) - DivisorSigma(0, k) : k in [1..n]]): n in [1..60]]; // _Vincenzo Librandi_, Aug 02 2019 %o A236632 (Python) %o A236632 from math import isqrt %o A236632 def A236632(n): return (s:=isqrt(n))**2*(1-s)+sum((q:=n//k)*((k<<1)+q-3) for k in range(1,s+1))>>1 # _Chai Wah Wu_, Oct 23 2023 %Y A236632 Partial sums of A065608. %Y A236632 Cf. A000005, A000203, A006218, A024916, A222548. %K A236632 nonn,easy %O A236632 1,3 %A A236632 _Omar E. Pol_, Jan 31 2014