OFFSET
1,2
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..10000
FORMULA
G.f.: Sum_{k>=2} floor(1/omega(k))*k*x^k/(1 - x^k), where omega(k) is the number of distinct prime factors (A001221). - Ilya Gutkovskiy, Jan 04 2017
a(n) = A023888(n) - 1. - Michel Marcus, Mar 21 2017
a(n) = Sum_{d|n} d * [omega(d) = 1], where omega is the number of distinct prime factors and [ ] is the Iverson bracket. - Wesley Ivan Hurt, Jan 28 2021
MATHEMATICA
Array[ Plus @@ (Select[ Divisors[ # ], PrimePowerQ ])&, 80 ]
PROG
(PARI) a(n) = sumdiv(n, d, if(isprimepower(d), d)); \\ Michel Marcus, Mar 21 2017; corrected by Daniel Suteu, Jul 20 2018
(PARI) a(n) = my(f = factor(n)); sum(k = 1, #f~, f[k, 1] * (f[k, 1]^f[k, 2] - 1) / (f[k, 1] - 1)) \\ Daniel Suteu, Jul 20 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved