OFFSET
1,2
COMMENTS
For each divisor d of n, add d if d is prime, otherwise add 1. For example, a(6) = 1 + 2 + 3 + 1 = 7.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
FORMULA
a(p) = p+1 for primes p. - Wesley Ivan Hurt, Nov 28 2021
MATHEMATICA
a[n_] := DivisorSum[n, #^Boole[PrimeQ[#]] &]; Array[a, 75] (* Amiram Eldar, Nov 11 2021 *)
PROG
(PARI) a(n) = sumdiv(n, d, if (isprime(d), d, 1)); \\ Michel Marcus, Nov 11 2021
(Python)
from math import prod
from sympy import factorint
def A349215(n):
fs = factorint(n)
return sum(a-1 for a in fs.keys())+prod(1+d for d in fs.values()) # Chai Wah Wu, Nov 11 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Nov 10 2021
STATUS
approved