Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #19 Apr 06 2015 03:14:52
%S 21,23,27,29,81,83,253,293,299,343,347,349,431,437,439,471,473,477,
%T 529,623,653,659,677,743,893,1123,1219,1253,1257,1297,1423,1489,1521,
%U 1523,1529,1587,1589,1657,1763,1853,1867,1927,2151,2167,2239,2277,2279,2321,2327,2329,2377,2413,2443,2459,2467,2497,2543,2569
%N Zeroless numbers n such that n + (product of digits of n) and n - (product of digits of n) are prime.
%C Intersection of A157676 and A229221 (without the primes containing zero digits).
%e 29 - 2*9 = 11 (prime) and 29 + 2*9 = 47 (prime) so 29 is a member of this sequence.
%e 743 - 7*4*3 = 659 (prime) and 743 + 7*4*3 = 827 (prime) so 743 is a member of this sequence.
%o (Python)
%o from sympy import isprime
%o def DP(n):
%o ..p = 1
%o ..for i in str(n):
%o ....p *= int(i)
%o ..return p
%o {print(n,end=', ') for n in range(5000) if DP(n) and isprime(n+DP(n)) and isprime(n-DP(n))}
%o ## Simplified by _Derek Orr_, Apr 05 2015
%o (PARI) for(n=1,5000,d=digits(n);p=prod(i=1,#d,d[i]);if(p&&isprime(n+p)&&isprime(n-p),print1(n,", "))) \\ _Derek Orr_, Apr 05 2015
%Y Cf. A157676, A229221, A007954, A052382.
%K nonn,base,easy
%O 1,1
%A _Derek Orr_, Oct 04 2013
%E More terms from _Derek Orr_, Apr 05 2015