login
A075595
Smallest prime that is obtained by placing digits on both sides of the n-th prime. Or smallest prime that encompasses the n-th prime.
11
127, 131, 151, 173, 1117, 2131, 1171, 1193, 1231, 1291, 1319, 1373, 2411, 1433, 1471, 1531, 1597, 1613, 2671, 2711, 1733, 2791, 1831, 2897, 1973, 21011, 21031, 11071, 11093, 11131, 11273, 11311, 21377, 11393, 11491, 11519, 11579, 11633
OFFSET
1,1
COMMENTS
For small primes, the prefix required is usually 1 or 2.
LINKS
MAPLE
f:= proc(n) local m, d, d1, v, x, y, y0, z, found;
m:= ilog10(n);
v:= infinity;
for d from 2 do
for d1 from 1 to d-1 do
found:= false;
for x from 10^(d1-1) to 10^d1-1 while not found do
if d-d1=1 then y0:= 1 else y0:= 10^(d-d1-1)+1 fi;
for y from y0 to 10^(d-d1)-1 by 2 do
z:= y+10^(d-d1)*n + 10^(d-d1+m+1)*x;
if isprime(z) then v:= min(v, z); found:= true; break fi
od od;
od;
if v < infinity then return v fi
od
end proc:
map(f@ithprime, [$1..100]); # Robert Israel, Aug 28 2018
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Sep 28 2002
EXTENSIONS
Corrected and extended by Sascha Kurz, Jan 20 2003
STATUS
approved