A385144 a(n) is the smallest 2*n + 1 digit prime consisting of a string of 2*n - 1 identical digits d sandwiched between two same digits different from d, or -1 if no such prime exists.
101, 13331, 1333331, 188888881, 74444444447, 1666666666661, 188888888888881, 16666666666666661, 1666666666666666661, 155555555555555555551, 75555555555555555555557, -1, -1, 72222222222222222222222222227, 3111111111111111111111111111113, 155555555555555555555555555555551
Offset: 1
Examples
a(1) = 101, because it contains one 0 that is flanked by two 1s, which are different from 0, and no smaller prime has this property.
Crossrefs
Cf. A384979.
Programs
-
Python
from sympy import isprime def a(n): return next((t for c in "123456789" for d in "0123456789" if c!=d and isprime(t:=int(c+d*(2*n-1)+c))), -1) print([a(n) for n in range(1, 17)]) # Michael S. Branicky, Jun 19 2025
Comments