This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A227217 #56 Mar 21 2020 16:37:59 %S A227217 23,29,83,101,103,107,109,293,307,347,349,401,409,431,439,503,509,601, %T A227217 607,653,659,677,701,709,743,809,907,1009,1013,1019,1021,1031,1033, %U A227217 1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1123,1201,1297,1301,1303,1307,1409,1423,1489,1523 %N A227217 Primes p such that p + (product of digits of p) is prime and p - (product of digits of p) is prime. %C A227217 Intersection of A157677 and A225319. %C A227217 Contains A056709. - _Robert Israel_, Apr 13 2015 %H A227217 Michael De Vlieger, <a href="/A227217/b227217.txt">Table of n, a(n) for n = 1..10000</a> %e A227217 431 is prime, 431 + (4*3*1) = 443 is prime, and 431 - (4*3*1) = 419 is prime. So, 431 is a term in the sequence. %p A227217 filter:= proc(n) local m; %p A227217 if not isprime(n) then return false fi; %p A227217 m:= convert(convert(n,base,10),`*`); %p A227217 if m = 0 then return true fi; %p A227217 isprime(n+m) and isprime(n-m) %p A227217 end proc: %p A227217 select(filter, [seq(2*i+1,i=5..10000)]); # _Robert Israel_, Apr 13 2015 %t A227217 fQ[n_] := Block[{d = IntegerDigits@ n}, PrimeQ[n + Times @@ d] && PrimeQ[n - Times @@ d]]; Select[Prime@ Range@ 250, fQ] (* _Michael De Vlieger_, Apr 12 2015 *) %o A227217 (Python) %o A227217 from sympy import isprime, primerange %o A227217 def DP(n): %o A227217 p = 1 %o A227217 for i in str(n): %o A227217 p *= int(i) %o A227217 return p %o A227217 for pn in primerange(1, 2000): %o A227217 dpn = DP(pn) %o A227217 if isprime(pn-dpn) and isprime(pn+dpn): %o A227217 print(pn, end=', ') %o A227217 # Simplified by _Derek Orr_, Apr 10 2015 %o A227217 (Sage) %o A227217 [p for p in primes_first_n(1000) if ((p-prod(Integer(p).digits(base=10))) in Primes() and (p+prod(Integer(p).digits(base=10))) in Primes())] # _Tom Edgar_, Sep 19 2013 %o A227217 (PARI) forprime(p=1,2000,d=digits(p);P=prod(i=1,#d,d[i]);if(isprime(p+P)&&isprime(p-P),print1(p,", "))) \\ _Derek Orr_, Apr 10 2015 %Y A227217 Cf. A007954, A056709, A157677, A225319. %K A227217 nonn,base %O A227217 1,1 %A A227217 _Derek Orr_, Sep 19 2013 %E A227217 More terms from _Derek Orr_, Apr 10 2015