OFFSET
1,4
LINKS
T. D. Noe, Table of n, a(n) for n=1..1000
FORMULA
G.f.: Sum_{k>=1} prime(k) * x^(2*prime(k)) / (1 - x^prime(k)). - Ilya Gutkovskiy, Apr 13 2021
EXAMPLE
a(12)=5 because 12's distinct prime factors 2 and 3 sum to 5.
MAPLE
f:= n -> convert(numtheory:-factorset(n) minus {n}, `+`):
map(f, [$1..100]); # Robert Israel, Sep 18 2023
MATHEMATICA
Table[Total@Select[Join@@Union@*Table@@@FactorInteger@k, #<k&], {k, 86}] (* Giorgos Kalogeropoulos, Nov 21 2021 *)
PROG
(Haskell)
a105221 n = a008472 n - n * fromIntegral (a010051 n)
-- Reinhard Zumkeller, Apr 05 2013
(PARI) a(n) = my(f=factor(n)); sum(k=1, #f~, if (f[k, 1]<n, f[k, 1])); \\ Michel Marcus, Nov 21 2021
(Python)
from sympy import primefactors
def A105221(n): return sum(p for p in primefactors(n) if p < n) # Chai Wah Wu, Sep 18 2023
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Alexandre Wajnberg, Apr 13 2005
EXTENSIONS
Edited by Don Reble, Nov 17 2005
STATUS
approved