A032437 Substrings from the right are prime numbers (using only odd digits different from 5).
3, 7, 13, 17, 37, 73, 97, 113, 137, 173, 197, 313, 317, 337, 373, 397, 773, 797, 937, 997, 1373, 1997, 3137, 3313, 3373, 3797, 7937, 9137, 9173, 9337, 9397, 13313, 33797, 39397, 79337, 79397, 91373, 91997, 99137, 99173, 99397, 139397, 379397
Offset: 1
Examples
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
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.
Programs
-
Mathematica
Select[Prime[Range[33000]],SubsetQ[{1,3,7,9},IntegerDigits[#]]&&AllTrue[Mod[#,10^Range[ IntegerLength[ #]-1]],PrimeQ]&] (* Harvey P. Dale, Jun 28 2022 *)
-
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
Extensions
Single-digit terms added by Eric W. Weisstein.
Comments