OFFSET
1,1
LINKS
David A. Corneth, Table of n, a(n) for n = 1..1744 (first 469 terms from Harry J. Smith and Chai Wah Wu)
FORMULA
Sum digits of n; take product of digits of n; multiply sum by product and divide into n. If prime, add to sequence.
EXAMPLE
a(2) = 111 because 1+1+1 = 3 and 1*1*1 = 1 and 3*1 = 3 and 111/3 = 37 and 37 is prime. [corrected by Harry J. Smith, Nov 08 2009]
MATHEMATICA
ndspQ[n_]:=Module[{idn=IntegerDigits[n]}, FreeQ[idn, 0]&&PrimeQ[n/(Total[ idn]Times@@idn)]]; Select[Range[35*10^6], ndspQ] (* Harvey P. Dale, Feb 09 2015 *)
PROG
(PARI) isok(k) = { my(d=digits(k), q=vecsum(d)*vecprod(d)); q!= 0 && k%q==0 && isprime(k/q) }
{ for(k=0, 10^7, if(isok(k), print1(k, ", "))) } \\ Harry J. Smith, Nov 08 2009
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Enoch Haga, Dec 13 2001
EXTENSIONS
Checked to over 10^8 (110508539) without finding another example.
Offset 1 from Harry J. Smith, Nov 08 2009
Should have found 34338816, 37121112, and 41174112 < 10^8. Term a(29) from Harry J. Smith, Nov 08 2009
STATUS
approved