OFFSET
1,1
EXAMPLE
For k = 54, its prime factorization is 2^1*3^3: 5+4 = 2+1+3+3 = 9.
For k = 756, its prime factorization is 2^2*3^3*7^1: 7+5+6 = 2+2+3+3+7+1 = 18.
MATHEMATICA
Select[Range[34000], DigitSum[#]==Total[Flatten[FactorInteger[#]]] &] (* Stefano Spezia, Sep 14 2024 *)
PROG
(Python)
from sympy.ntheory import factorint
c = 2
while c < 10000:
charsum = 0
for char in str(c):
charsum += int(char)
pf = factorint(c)
cand = 0
for p in pf.keys():
cand += p
cand += pf[p]
if charsum == cand:
print(c)
print(pf)
c += 1
(PARI) isok(k)={my(f=factor(k)); vecsum(f[, 1]) + vecsum(f[, 2]) == sumdigits(k)} \\ Andrew Howroyd, Sep 26 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jordan Brooks, Sep 12 2024
STATUS
approved