[go: up one dir, main page]

login
A079667
a(n) = (1/2) * Sum_{d divides n} abs(n/d-d).
11
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, 32, 42, 28, 50, 30, 49, 40, 48, 36, 65, 36, 54, 48, 66, 40, 72, 42, 70, 60, 66, 46, 92, 48, 77, 64, 84, 52, 96, 60, 92, 72, 84, 58, 126, 60, 90, 82, 105, 72, 120, 66, 112, 88, 114, 70
OFFSET
1,3
COMMENTS
Also, Sum_{i|n, sqrt(n)<i<=n} i - Sum_{i|n, 1<=i<sqrt(n)} i.
REFERENCES
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.
LINKS
FORMULA
a(n) = A070038(n) - A066839(n).
G.f.: Sum_{k>0} x^(k^2+k)/(1-x^k)^2 . - Michael Somos, Nov 19 2005
MATHEMATICA
Table[DivisorSum[n, Abs[n/# - #] &, # <= Sqrt[n] &], {n, 71}] (* Michael De Vlieger, Mar 17 2021 *)
PROG
(PARI) a(n)=if(n<2, 0, sumdiv(n, d, abs(n/d-d))/2) /* Michael Somos, Nov 19 2005 */
(SageMath)
def A079667(n): return sum(n//d - d for d in divisors(n) if d*d <= n)
print([A079667(n) for n in range(1, 72)]) # Peter Luschny, Jan 01 2024
CROSSREFS
Sequence in context: A094871 A157450 A195013 * A073061 A300526 A006874
KEYWORD
easy,nonn
AUTHOR
Vladeta Jovovic, Jan 25 2003
STATUS
approved