OFFSET
0,1
COMMENTS
For n=5620 and n=7358, adding only one digit to both sides do not result in any prime. - Robert Price, Sep 16 2023
LINKS
FORMULA
If n is prime, then a(n) = n, else a(n) = A084414(n). - Michel Marcus, Oct 05 2013
EXAMPLE
a(1)=113 because 113 is the smallest prime with "1" as central digit.
a(10)=1103 because 1103 is the smallest prime with "10" as central digits.
PROG
(PARI) findex(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)); ); ); }
a(n) = if (isprime(n), n, findex(n)); \\ 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
Escape clause added by N. J. A. Sloane, Nov 11 2020
STATUS
approved