login
A240678
Primes p such that p*10+k is prime for exactly one value of the digit k.
4
11, 29, 41, 47, 71, 79, 83, 131, 137, 139, 151, 163, 173, 181, 191, 227, 257, 263, 277, 281, 293, 307, 311, 313, 359, 383, 449, 491, 503, 509, 557, 563, 569, 577, 587, 593, 601, 617, 647, 659, 661, 677, 683, 719, 739, 743, 751, 809, 821, 827, 857, 877, 881
OFFSET
1,1
LINKS
EXAMPLE
11 is in the sequence because 113 is prime, but 111, 117 and 119 are not prime.
MATHEMATICA
Select[Prime[Range[200]], Total[Boole[PrimeQ[10 #+{1, 3, 7, 9}]]]==1&] (* Harvey P. Dale, Apr 19 2019 *)
PROG
(PARI) forprime(p=2, 1500, t=0; forstep(k=1, 9, 2, if(isprime(p*10+k), t++)); if(t==1, print1(p, ", ")))
(Python)
from sympy import isprime, primerange
def ok(p): return sum(1 for k in [1, 3, 7, 9] if isprime(p*10+k)) == 1
def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
print(aupto(881)) # Michael S. Branicky, Nov 29 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Colin Barker, Apr 10 2014
STATUS
approved