login
A229221
Numbers n such that n - (product of digits of n) is prime.
1
21, 23, 27, 29, 41, 43, 47, 49, 81, 83, 87, 89, 101, 103, 107, 109, 127, 141, 143, 149, 181, 187, 223, 227, 229, 241, 247, 251, 253, 263, 271, 277, 293, 299, 307, 343, 347, 349, 367, 383, 389, 401, 409, 413, 417, 419, 431, 433, 437, 439, 451, 457, 471, 473, 477, 479, 481, 487, 503, 509, 527, 529, 541
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
Cf. A157676.
Sequence in context: A366202 A089787 A329914 * A157676 A227948 A303718
KEYWORD
nonn,base,easy
AUTHOR
Derek Orr, Sep 16 2013
EXTENSIONS
More terms from Derek Orr, Apr 10 2015
STATUS
approved