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”).

A217064
Primes that remain prime when a single "5" digit is inserted between any two adjacent decimal digits.
3
11, 17, 47, 71, 83, 89, 149, 167, 179, 251, 257, 293, 347, 359, 383, 419, 461, 467, 491, 557, 563, 569, 653, 773, 911, 1193, 1217, 1277, 1451, 1559, 1667, 1823, 1901, 2243, 2309, 2357, 2579, 2657, 2999, 3527, 3533, 4289, 5051, 5351, 5501, 5843, 6089, 6551, 6581
OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..500 (* First 140 terms from Paolo P. Lava *)
EXAMPLE
290183 is prime and also 2901853, 2901583, 2905183, 2950183 and 2590183.
MAPLE
with(numtheory);
A217064:=proc(q, x)
local a, b, c, i, n, ok;
for n from 5 to q do
a:=ithprime(n); b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od; a:=ithprime(n); ok:=1;
for i from 1 to b-1 do
c:=a+9*10^i*trunc(a/10^i)+10^i*x; if not isprime(c) then ok:=0; break; fi; od;
if ok=1 then print(ithprime(n)); fi; od; end:
A217064(1000000, 5);
MATHEMATICA
Select[Prime[Range[5, 1000]], AllTrue[FromDigits/@Table[ Insert[ IntegerDigits[ #], 5, n], {n, 2, IntegerLength[#]}], PrimeQ]&] (* Harvey P. Dale, Feb 20 2022 *)
PROG
(PARI) is(n)=my(v=concat([""], digits(n))); for(i=2, #v-1, v[1]=Str(v[1], v[i]); v[i]=5; if(i>2, v[i-1]=""); if(!isprime(eval(concat(v))), return(0))); isprime(n) \\ Charles R Greathouse IV, Sep 26 2012
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Sep 26 2012
STATUS
approved