OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = Sum_{k=1..n} k * (ceiling(n/k^3) - floor(n/k^3)) * (1 - ceiling(n/k) + floor(n/k)).
EXAMPLE
a(16) = 28; The divisors of 16 whose cube does not divide 16 are: 4, 8 and 16. The sum of these divisors is then 4 + 8 + 16 = 28.
MATHEMATICA
Table[Sum[k (Ceiling[n/k^3] - Floor[n/k^3]) (1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 80}]
Table[Total[Select[Divisors[n], Mod[n, #^3]!=0&]], {n, 100}] (* Harvey P. Dale, May 01 2022 *)
PROG
(PARI) a(n) = sumdiv(n, d, if (n % d^3, d)); \\ Michel Marcus, Jun 13 2021
(Python 3.8+)
from math import prod
from sympy import factorint
def A345321(n):
f = factorint(n).items()
return prod((p**(q+1)-1)//(p-1) for p, q in f) - prod((p**(q//3+1)-1)//(p-1) for p, q in f) # Chai Wah Wu, Jun 14 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Jun 13 2021
STATUS
approved