cp's OEIS Frontend

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.

A079667 a(n) = (1/2) * Sum_{d divides n} abs(n/d-d).

This page as a plain text file.
%I A079667 #21 Jan 01 2024 13:02:24
%S A079667 0,1,2,3,4,6,6,9,8,12,10,16,12,18,16,21,16,27,18,28,24,30,22,40,24,36,
%T A079667 32,42,28,50,30,49,40,48,36,65,36,54,48,66,40,72,42,70,60,66,46,92,48,
%U A079667 77,64,84,52,96,60,92,72,84,58,126,60,90,82,105,72,120,66,112,88,114,70
%N A079667 a(n) = (1/2) * Sum_{d divides n} abs(n/d-d).
%C A079667 Also, Sum_{i|n, sqrt(n)<i<=n} i - Sum_{i|n, 1<=i<sqrt(n)} i.
%D A079667 H. J. S. Smith, Report on the Theory of Numbers, reprinted in Vol. 1 of his Collected Math. Papers, Chelsea, NY, 1979, see p. 323.
%H A079667 Alois P. Heinz, <a href="/A079667/b079667.txt">Table of n, a(n) for n = 1..10000</a>
%F A079667 a(n) = A070038(n) - A066839(n).
%F A079667 G.f.: Sum_{k>0} x^(k^2+k)/(1-x^k)^2 . - _Michael Somos_, Nov 19 2005
%t A079667 Table[DivisorSum[n, Abs[n/# - #] &, # <= Sqrt[n] &], {n, 71}] (* _Michael De Vlieger_, Mar 17 2021 *)
%o A079667 (PARI) a(n)=if(n<2, 0, sumdiv(n,d, abs(n/d-d))/2) /* _Michael Somos_, Nov 19 2005 */
%o A079667 (SageMath)
%o A079667 def A079667(n): return sum(n//d - d for d in divisors(n) if d*d <= n)
%o A079667 print([A079667(n) for n in range(1, 72)])  # _Peter Luschny_, Jan 01 2024
%Y A079667 Cf. A060866, A116589.
%K A079667 easy,nonn
%O A079667 1,3
%A A079667 _Vladeta Jovovic_, Jan 25 2003