OFFSET
1,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
n = 1000: prime set = {2, 5}, a[1000] = 7;
n = 255255: prime set={3, 5, 7, 11, 13, 17}, a[255255]= 3+5+7+2+4+8 = 29.
MATHEMATICA
ffi[x_] :=Flatten[FactorInteger[x]] lf[x_] :=Length[FactorInteger[x]] ba[x_] :=Table[Part[ffi[x], 2*j-1], {j, 1, lf[x]}] sd[x_] :=Apply[Plus, IntegerDigits[x]] tdp[x_] :=Flatten[Table[IntegerDigits[Part[ba[x], j]], {j, 1, lf[x]}], 1] sdp[x_] :=Apply[Plus, tdp[x]] Table[sdp[w], {w, 1, 150}]
Table[Total[Flatten[IntegerDigits[First/@FactorInteger[n]]]], {n, 1, 100}] (Zak Seidov)
PROG
(Python)
from sympy import factorint
def a(n): return sum(sum(map(int, str(p))) for p in factorint(n))
print([a(n) for n in range(1, 91)]) # Michael S. Branicky, Dec 12 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Labos Elemer, Jun 21 2004
STATUS
approved