[go: up one dir, main page]

login
A279847
a(n) = Sum_{k=1..n} k^2*(floor(n/k) - 1).
5
0, 1, 2, 7, 8, 22, 23, 44, 54, 84, 85, 151, 152, 206, 241, 326, 327, 458, 459, 605, 664, 790, 791, 1065, 1091, 1265, 1356, 1622, 1623, 2023, 2024, 2365, 2496, 2790, 2865, 3480, 3481, 3847, 4026, 4636, 4637, 5373, 5374, 6000, 6341, 6875, 6876, 7982, 8032, 8787, 9086, 9952, 9953, 11137, 11284
OFFSET
1,3
COMMENTS
Sum of all squares of proper divisors of all positive integers <= n.
Total volume of all rectangular prisms with dimensions (x, x, z) and integers x and y, such that x + y = n, 0 < x <= y, and z = floor(y/x). - Wesley Ivan Hurt, Dec 21 2020
FORMULA
G.f.: -x*(1 + x)/(1 - x)^4 + (1/(1 - x))*Sum_{k>=1} k^2*x^k/(1 - x^k).
a(n) = A064602(n) - A000330(n).
a(n) = Sum_{k=1..n} A067558(k).
a(n) = Sum_{k=1..n} (A001157(k) - A000290(k)).
a(p^k) = a(p^k-1) + (p^(2*k) - 1)/(p^2 - 1), for p is prime.
a(n) ~ ((zeta(3) - 1)/3)*n^3.
a(n) = Sum_{k=1..floor(n/2)} k^2 * floor((n-k)/k). - Wesley Ivan Hurt, Dec 21 2020
EXAMPLE
For n = 7 the proper divisors of the first seven positive integers are {0}, {1}, {1}, {1, 2}, {1}, {1, 2, 3}, {1} so a(7) = 0^2 + 1^2 + 1^2 + 1^2 + 2^2 + 1 ^2 + 1^2 + 2^2 + 3^2 + 1^2 = 23.
MATHEMATICA
Table[Sum[k^2 (Floor[n/k] - 1), {k, 1, n}], {n, 55}]
Table[Sum[DivisorSigma[2, k] - k^2, {k, 1, n}], {n, 55}]
PROG
(PARI) a(n) = sum(k=1, n, k^2*(floor(n/k)-1)) \\ Felix Fröhlich, Dec 20 2016
(Python)
from math import isqrt
def A279847(n): return (-n*(n+1)*(2*n+1)-(s:=isqrt(n))**2*(s+1)*(2*s+1) + sum((q:=n//k)*(6*k**2+q*(2*q+3)+1) for k in range(1, s+1)))//6 # Chai Wah Wu, Oct 21 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ilya Gutkovskiy, Dec 20 2016
STATUS
approved