login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A245657
Primes p for which none of the concatenations p3, p9, 3p, 9p are primes.
1
3, 107, 113, 179, 317, 443, 487, 599, 641, 653, 751, 773, 937, 977, 991, 1021, 1087, 1103, 1187, 1201, 1213, 1217, 1301, 1409, 1427, 1439, 1483, 1553, 1559, 1579, 1609, 1637, 1693, 1747, 1777, 1787, 1789, 1861, 1949, 1987, 1993, 2081, 2129, 2239, 2281, 2287, 2293, 2351, 2393, 2477
OFFSET
1,1
LINKS
MATHEMATICA
Select[Prime[Range[400]], NoneTrue[{10#+3, 10#+9, 3*10^IntegerLength[#]+#, 9*10^IntegerLength[ #]+#}, PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 06 2020 *)
PROG
(PARI) lista(nn) = {forprime(p=2, nn, if (!isprime(eval(concat(Str(p), Str(3)))) && ! isprime(eval(concat(Str(p), Str(9)))) && ! isprime(eval(concat(Str(3), Str(p)))) && ! isprime(eval(concat(Str(9), Str(p)))), print1(p, ", ")); ); } \\ Michel Marcus, Sep 14 2014
(Python)
import sympy
from sympy import isprime
from sympy import prime
for n in range(1, 10**3):
..p = str(prime(n))
..if not isprime(p+'3') and not isprime(p+'9') and not isprime('3'+p) and not isprime('9'+p):
....print(int(p), end=', ') # Derek Orr, Sep 16 2014
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Vladimir Shevelev, Sep 13 2014
EXTENSIONS
More terms from Derek Orr, Sep 16 2014
STATUS
approved