OFFSET
1,4
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
The divisors of 16 that are cubefree are {1, 2, 4}, and their sum is a(16) = 1 + 2 + 4 = 7.
MATHEMATICA
f[p_, e_] := 1 + p + If[e == 1, 0, p^2]; a[1] = 0; a[n_] := Times @@ f @@@ (fct = FactorInteger[n]) - If[AllTrue[fct[[;; , 2]], # < 3 &], n, 0]; Array[a, 100]
PROG
(PARI) a(n) = {my(f = factor(n), s); s = prod(i=1, #f~, 1 + f[i, 1] + if(f[i, 2] == 1, 0, f[i, 1]^2)); if(n==1 || vecmax(f[, 2]) < 3, s -= n); s};
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Oct 10 2022
STATUS
approved