login
A084414
Smallest prime > n having "n" as central digits(s), or -1 if no such prime exists.
4
101, 113, 127, 131, 149, 151, 163, 173, 181, 191, 1103, 1117, 1123, 2131, 2141, 1151, 1163, 1171, 1181, 1193, 1201, 1213, 1223, 1231, 1249, 1259, 2267, 1277, 1283, 1291, 1301, 1319, 1321, 2333, 2341, 2351, 1361, 1373, 1381, 1399, 1409, 2411, 1423, 1433, 1447
OFFSET
0,1
COMMENTS
a(n) >= A084413(n), with equality when n is prime. - Michel Marcus, Oct 05 2013
For n=2437, 5620 and 7358 adding one digit on each side of n does not produce any prime. - Robert Price, Sep 16 2023
EXAMPLE
a(1)=113 because 113 is the smallest prime >1 having "1" as central digit.
PROG
(PARI) a(n) = {for (i = 1, 9, forstep (j=1, 9, 2, v = j + 10*n + i*10^(1+length(Str(n))); if (isprime(v), return (v)); ); ); } \\ code assumes only 1 digit on each side of 'n' will be necessary. See A032734 for numbers that need a better script. - Michel Marcus, Oct 05 2013
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Zak Seidov, Jun 24 2003
EXTENSIONS
a(21) inserted and more terms from Michel Marcus, Oct 05 2013
Escape clause added by N. J. A. Sloane, Nov 11 2020
STATUS
approved