OFFSET
1,1
COMMENTS
Primes p with decimal expansion d_1 d_2 d_3 ... d_k such that the digits d_i are 1, 3, 7, or 9, and deleting 1, 2, 3, up to k-1 leading digits also produces a prime. For example, 9173 is a term because all of 9173, 173, 73, and 3 are primes. - N. J. A. Sloane, Jun 28 2022
LINKS
T. D. Noe, Table of n, a(n) for n = 1..58 [The complete list of terms]
C. Rivera, Prime strings
Eric Weisstein's World of Mathematics, Truncatable Prime.
EXAMPLE
173 is a term because 173, 73, and 3 are all primes. 371 is not a term because 371 and 1 are not primes. - N. J. A. Sloane, Jun 28 2022
MATHEMATICA
Select[Prime[Range[33000]], SubsetQ[{1, 3, 7, 9}, IntegerDigits[#]]&&AllTrue[Mod[#, 10^Range[ IntegerLength[ #]-1]], PrimeQ]&] (* Harvey P. Dale, Jun 28 2022 *)
PROG
(PARI) is(n)=my(d=digits(n)); for(i=1, n, if(!isprime(fromdigits(d[i..n])), return(0))); 1 \\ Charles R Greathouse IV, Jun 25 2017
CROSSREFS
KEYWORD
nonn,fini,full,base,nice,changed
AUTHOR
EXTENSIONS
Single-digit terms added by Eric W. Weisstein.
STATUS
approved