login
A360781
Primes p such that at least one number remains prime when p is bracketed by a single digit d; that is, at least one instance of d//p//d is prime where // means concatenation.
1
2, 3, 5, 7, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 101, 103, 107, 109, 113, 131, 139, 149, 151, 157, 163, 173, 179, 191, 193, 197, 211, 223, 227, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331
OFFSET
1,1
COMMENTS
The bracketing digit d must be 1, 3, 7, or 9.
LINKS
FORMULA
Union of A069687, A069688, A069689, A069690. - Alois P. Heinz, Feb 22 2023
EXAMPLE
263 is included because 263 is a prime and 32633 (and also 92639) is a prime.
MAPLE
q:= p-> ormap(isprime, map(d-> parse(cat(d, p, d)), [1, 3, 7, 9])):
select(q, [ithprime(i)$i=1..67])[]; # Alois P. Heinz, Feb 22 2023
MATHEMATICA
brkQ[p_]:=AnyTrue[Table[FromDigits[Join[{d}, IntegerDigits[p], {d}]], {d, {1, 3, 7, 9}}], PrimeQ]; Select[Prime[Range[100]], brkQ]
PROG
(Python)
from sympy import isprime, nextprime
from itertools import islice
def agen(): # generator of terms
p = 2
while True:
sp = str(p)
if any(isprime(int(d+sp+d)) for d in "1379"):
yield p
p = nextprime(p)
print(list(islice(agen(), 57))) # Michael S. Branicky, Feb 20 2023
(PARI) is(p) = my(d=digits(p)); forstep(k=1, 9, 2, if (isprime(fromdigits(concat(k, concat(d, k)))), return(1)));
isok(p) = if (isprime(p), is(p)); \\ Michel Marcus, Feb 20 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Harvey P. Dale, Feb 20 2023
STATUS
approved