OFFSET
1,1
COMMENTS
The palindromic Smith numbers (A098834) are a subset of the reversible Smith numbers.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
S. S. Gupta, Smith Numbers.
EXAMPLE
a(3) = 58 because 58 and its reverse 85 are Smith numbers.
MATHEMATICA
rev[n_] := FromDigits @ Reverse @ IntegerDigits[n]; digSum[n_] := Plus @@ IntegerDigits[n]; smithQ[n_] := CompositeQ[n] && Plus @@ (Last@#*digSum[First@#] & /@ FactorInteger[n]) == digSum[n]; Select[Range[6000], smithQ[#] && smithQ @ rev[#] &] (* Amiram Eldar, Aug 24 2020 *)
PROG
(Python)
from sympy import factorint
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 ok(n): return smith(n) and smith(int(str(n)[::-1]))
print(list(filter(ok, range(6296)))) # Michael S. Branicky, Apr 22 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Shyam Sunder Gupta, Mar 10 2005
STATUS
approved