OFFSET
1,1
MATHEMATICA
fQ[n_] := Module[{q = n - Times @@ IntegerDigits[n]}, q > 0 && PrimeQ[q]]; Select[Range[500], fQ] (* T. D. Noe, Sep 17 2013 *)
PROG
(Python)
from sympy import isprime
def DP(n):
p = 1
for i in str(n):
p *= int(i)
return p
{print(n, end=', ') for n in range(10**3) if isprime(n-DP(n))}
## Simplified by Derek Orr, Apr 10 2015
(Sage)
[x for x in range(1000) if (x-prod(Integer(x).digits(base=10))) in Primes()] # Tom Edgar, Sep 18 2013
(PARI) for(n=1, 10^3, d=digits(n); p=prod(i=1, #d, d[i]); if(isprime(n-p), print1(n, ", "))) \\ Derek Orr, Apr 10 2015
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Derek Orr, Sep 16 2013
EXTENSIONS
More terms from Derek Orr, Apr 10 2015
STATUS
approved