%I #9 Apr 03 2023 10:36:11
%S 29,31,59,71,79,229,239,251,271,331,359,379,521,571,739,751,2221,2239,
%T 2251,2339,2351,2371,2521,2531,2539,2551,2579,2729,2731,3221,3229,
%U 3251,3259,3271,3329,3331,3359,3371,3529,3539,3559,3571,3739,3779,5231,5279
%N Primes whose last digit is not a prime but all the other digits are primes.
%C It is obvious that the last digit must be a 1 or 9. It is also obvious that the digits 0, 4, 6, or 8 cannot occur anywhere in the numbers.
%H Chris Caldwell, <a href="https://t5k.org/lists/small/1000.txt">The First 1,000 Primes</a>
%e 751 is a prime in which the last digit is not a prime but the other digits are primes.
%p a := proc (n) local n1, n2, n3: n1 := ithprime(n): n2 := convert(n1, base, 10): n3 := convert(convert(floor((1/10)*n1), base, 10), set): if member(n2[1], {1, 9}) = true and `subset`(n3, {2, 3, 5, 7}) = true then n1 else end if end proc: seq(a(n), n = 1 .. 750); # _Emeric Deutsch_, Mar 15 2009
%Y Cf. A000040, A156553.
%K base,nonn
%O 1,1
%A _Parthasarathy Nambi_, Feb 19 2009
%E More terms from _Emeric Deutsch_, Mar 15 2009