OFFSET
1,1
COMMENTS
a(n) is the least composite k >= 10^(n-1) such that the sum of the decimal digits of k is equal to the sum of the decimal digits of the prime factors of k, counted with multiplicity.
Almost certainly a(n) has exactly n digits, but "at least" is included in the Name since we have no proof of that.
EXAMPLE
a(5) = 10086 because 10086 has digit-sum 15 and 10086 = 2 * 3 * 41^2 with 2 + 3 + (4 + 1) + (4 + 1) = 15, and no k from 10000 to 10085 works.
MAPLE
f:= proc(n) local t, x;
for x from 10^(n-1) do
if isprime(x) then next fi;
if convert(convert(x, base, 10), `+`) = add(t[2]*convert(convert(t[1], base, 10), `+`), t = ifactors(x)[2]) then return x fi;
od
end proc:
map(f, [$1..30]);
PROG
(Python)
from sympy import factorint
from itertools import count
def sd(n): return sum(map(int, str(n)))
def is_smith(n):
f = factorint(n)
return sum(f[p] for p in f) > 1 and sd(n) == sum(sd(p)*f[p] for p in f)
def a(n): return next(k for k in count(10**(n-1)) if is_smith(k))
print([a(n) for n in range(1, 23)]) # Michael S. Branicky, Aug 25 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Aug 25 2024
STATUS
approved