login
Primes p such that p * (product of digits of p) - 2 is prime.
2

%I #24 Feb 28 2024 10:47:43

%S 2,3,5,7,13,73,113,173,193,197,359,373,937,1117,1153,1531,1571,1597,

%T 1777,1951,1979,3119,3313,3517,3539,3557,3571,5119,5399,5591,5779,

%U 7159,7177,7351,7393,7573,7757,7793,7933,7951,9133,9511,9533,9931,9973,11119,11131

%N Primes p such that p * (product of digits of p) - 2 is prime.

%C Except for 2, a subset of A030096. - _Robert Israel_, Jul 18 2019

%C Primes with zero as a digit are excluded. - _Harvey P. Dale_, Jan 02 2020

%H Hauke Löffler, <a href="/A309249/b309249.txt">Table of n, a(n) for n = 1..1638</a>

%e 2 is in the sequence because 2*(2) - 2 = 2 (prime);

%e 359 is in the sequence because 359*(3*5*9) - 2 = 48463 (prime).

%t ppd2Q[n_]:=Module[{c=n Times@@IntegerDigits[n]-2},c>0&&PrimeQ[c]]; Select[ Prime[Range[1500]],ppd2Q] (* _Harvey P. Dale_, Jan 02 2020 *)

%o (SageMath) P = Primes(); [ P.unrank(p) for p in range(1000) if is_prime( P.unrank(p) * prod([int(i) for i in str(P.unrank(p)) ] ) - 2 )]

%Y Cf. A000040, A030096, A309248.

%K nonn,base

%O 1,1

%A _Hauke Löffler_, Jul 18 2019