login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A345223 a(n) is the smallest k >= 0 such that the decimal concatenation 1 (n times) || k || 1 (n times) is a prime, or -1 if no such k exists. 0
0, 3, 4, 8, 10, 8, 5, 21, 1, 6, 1, 116, 23, 6, 73, 24, 16, 62, 3, 10, 19, 53, 61, 58, 191, 9, 265, 12, 133, 86, 141, 4, 7, 39, 193, 31, 51, 13, 31, 6, 31, 53, 287, 139, 4, 239, 187, 25, 18, 144, 31, 38, 93, 86, 27, 30, 16, 24, 6, 356, 50, 91, 395, 117, 217, 61 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(n) = 0 only for n = 1, since A138148(1) = 101 is the only prime in A138148.
a(n) = 1 iff n is of the form (A004023(i)-1)/2 for some i >= 1.
No term equals 2, see second comment in A258372.
LINKS
EXAMPLE
For n = 3: 1110111, 1111111, 1112111 and 1113111 are all composite, while 1114111 is prime, so the smallest number that can be inserted between strings of three ones so that the concatenation is prime is 4. Therefore a(3) = 4.
PROG
(PARI) eva(n) = subst(Pol(n), x, 10)
a(n) = my(v=vector(n, t, 1), d, w=[]); for(k=0, oo, d=digits(k); w=concat(v, d); w=concat(w, v); if(ispseudoprime(eva(w)), return(k)))
(Python)
from sympy import isprime
def a(n, d=1):
k, bread = 0, str(d)*n
while not isprime(int(bread + str(k) + bread)): k += 1
return k
print([a(n) for n in range(1, 67)]) # Michael S. Branicky, Jun 11 2021
CROSSREFS
Sequence in context: A113057 A253606 A258640 * A185726 A152520 A239976
KEYWORD
nonn,base,less
AUTHOR
Felix Fröhlich, Jun 11 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)