A117835 Prime numbers for which the product of the digits is a noncomposite number.
2, 3, 5, 7, 11, 13, 17, 31, 71, 113, 131, 151, 211, 311, 1117, 1151, 1171, 1511, 2111, 11113, 11117, 11131, 11171, 11311, 111121, 111211, 112111, 113111, 131111, 311111, 511111, 1111151, 1111211, 1111711, 1117111, 1171111, 11111117, 11111131, 11111171, 11111311, 11113111, 11131111
Offset: 1
Crossrefs
Programs
-
Mathematica
Select[Prime[Range[10^6]],PrimeQ[Times@@IntegerDigits[#]]||Times@@IntegerDigits[#]==1&] (* James C. McMahon, Sep 24 2024 *)
-
PARI
select( is_A117835(n)=isprime(n)&&(isprime(n=vecprod(digits(n)))||n==1), [0..999]) \\ In older PARI versions, vecprod=factorback. \\ M. F. Hasler, Apr 23 2019
-
PARI
next_A117835(n)={until( isprime(n), my(d=digits(n)); n=if(n<3||Set(d)==[1], n+1, fromdigits(apply(t->if(t<2, 1, t<7, nextprime(t+1), 11), d))));n} A117835_vec(N=99)=vector(N,i,t=next_A117835(if(i>1,t))) \\ M. F. Hasler, Apr 23 2019
Formula
Extensions
Name changed, following a remark from Zak Seidov, and edited by M. F. Hasler, Apr 22 2019
Comments