login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)