OFFSET
1,1
LINKS
S. S. Gupta, Smith Numbers.
MATHEMATICA
d[n_]:=IntegerDigits[n]; tr[n_]:=Transpose[FactorInteger[n]]; a[n_]:=NestList[FromDigits[Flatten[d[{#, n}]]]&, n, 55]; t={}; Do[If[!PrimeQ[n]&&Total[d[n]]==Total[d@tr[n][[1]]*tr[n][[2]], 2], AppendTo[t, n]], {n, Drop[Union[Flatten[Table[a[k], {k, 9}]]], 1]}]; t (* Jayanta Basu, Jun 04 2013 *)
PROG
(Python)
from sympy import factorint
from itertools import product
def sd(n): return sum(map(int, str(n)))
def 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 repsto(limit):
yield from range(min(limit, 9)+1)
for rep in range(2, 10**len(str(limit))):
for digit in "123456789":
out = int(digit*rep)
if out > limit: return
yield out
print(list(filter(smith, repsto(10**32)))) # Michael S. Branicky, Apr 22 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Shyam Sunder Gupta, Mar 10 2005
STATUS
approved