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 A229176 #46 Oct 16 2024 14:52:52 %S A229176 23,29,83,293,347,349,431,439,653,659,677,743,1123,1297,1423,1489, %T A229176 1523,1657,1867,2239,2377,2459,2467,2543,2579,2663,2753,3163,3253, %U A229176 3271,3329,3457,3461,3581,3691,3727,3833,3947,3967,4129,4253,4297,4423,4567,4957,5323,5381,5651 %N A229176 Primes p with nonzero digits such that p + product_of_digits and p - product_of_digits are both prime. %C A229176 Numbers with nonzero digits in A227217; the non-degenerate cases, so to speak. %C A229176 Intersection of primes with nonzero digits in A157677 and A225319. %H A229176 Vincenzo Librandi, <a href="/A229176/b229176.txt">Table of n, a(n) for n = 1..1000</a> %e A229176 743 is prime. %e A229176 743 - (7*4*3) = 659 is prime. %e A229176 743 + (7*4*3) = 827 is prime. %e A229176 So, 743 is a member of this sequence. %p A229176 A007954 := proc(n) %p A229176 mul(d, d=convert(n, base, 10)) %p A229176 end proc: %p A229176 isA229176 := proc(n) %p A229176 if isprime(n) and A007954(n) <> 0 then %p A229176 isprime(n+A007954(n)) and isprime(n-A007954(n)) ; %p A229176 simplify(%) ; %p A229176 else %p A229176 false; %p A229176 end if; %p A229176 end proc: %p A229176 for n from 1 to 10000 do %p A229176 if isA229176(n) then %p A229176 printf("%d,",n) ; %p A229176 end if; %p A229176 end do: %t A229176 id[x_] := IntegerDigits[x]; ti[x_] := Times @@ id[x]; m=5000; Select[Range[3,m,2], PrimeQ[#] && Min[id[#]] > 0 && PrimeQ[#+ti[#]] && PrimeQ[#-ti[#]]&] (* _Zak Seidov_, Oct 02 2013 *) %t A229176 t@n_ := Block[{p = Times @@ IntegerDigits@n}, %t A229176 If[p == 0, {0}, n + {-p, p}]]; Select[Prime@Range@1000, %t A229176 AllTrue[t@#, PrimeQ] &] (* _Hans Rudolf Widmer_, Dec 13 2021 *) %o A229176 (Python) %o A229176 import sympy %o A229176 from sympy import isprime %o A229176 def DP(n): %o A229176 p = 1 %o A229176 for i in str(n): %o A229176 p *= int(i) %o A229176 return p %o A229176 {print(n, end=', ') for n in range(10**4) if DP(n) and isprime(n) and isprime(n+DP(n)) and isprime(n-DP(n))} %o A229176 # Simplified by _Derek Orr_, Mar 22 2015 %o A229176 (PARI) forprime(p=1,10^4,d=digits(p);P=prod(i=1,#d,d[i]);if(P&&isprime(p+P)&&isprime(p-P),print1(p,", "))) \\ _Derek Orr_, Mar 22 2015 %Y A229176 Cf. A227217, A157677, A225319. %K A229176 nonn,base,easy %O A229176 1,1 %A A229176 _Derek Orr_, Sep 30 2013