login
A069690
Primes that yield another prime on placing a 9 on both sides (as leading and trailing digits).
7
2, 19, 23, 31, 41, 43, 47, 53, 61, 67, 71, 73, 83, 101, 107, 109, 113, 149, 163, 193, 211, 239, 241, 263, 269, 277, 313, 317, 331, 347, 373, 397, 409, 421, 439, 443, 499, 521, 523, 541, 547, 607, 617, 619, 641, 647, 673, 677, 757, 787, 829, 863, 877, 907, 911
OFFSET
1,1
LINKS
EXAMPLE
241 belongs to this sequence as 92419 is also a prime.
MAPLE
filter:= proc(n) isprime(9+10*n+9*10^(2+ilog10(n))) end proc:
select(filter, [seq(ithprime(i), i=1..1000)]); # Robert Israel, Feb 02 2021
MATHEMATICA
Select[ Range[2000], PrimeQ[ # ] && PrimeQ[ FromDigits[ Insert[ IntegerDigits[ # ], 9, {{1}, {-1}}]]] &]
Select[Prime[Range[200]], PrimeQ[FromDigits[Join[{9}, IntegerDigits[#], {9}]]]&] (* Harvey P. Dale, Nov 07 2022 *)
PROG
(Python)
from sympy import isprime, primerange
def ok(p): return isprime(int('9'+str(p)+'9'))
def aupto(lim): return [p for p in primerange(2, lim+1) if ok(p)]
print(aupto(911)) # Michael S. Branicky, Feb 19 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amarnath Murthy, Apr 06 2002
EXTENSIONS
Edited and extended by Robert G. Wilson v, May 03 2002
STATUS
approved