OFFSET
1,1
COMMENTS
a(369) has 1002 digits. - Michael S. Branicky, Dec 29 2025
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..368
FORMULA
PROG
(Python)
from gmpy2 import is_prime, mpz
from itertools import count, product
def a(n):
s = "".join(str(i) for i in range(1, n+1))
t = mpz(s)
if is_prime(t): return int(t)
cands = set()
for d in count(1):
for w in product("0123456789", repeat=d):
w = "".join(w)
for i in range(d+1):
v = w[:i] + s + w[i:]
if v[0] != "0" and is_prime(t:=mpz(v)):
cands.add(t)
if cands:
return int(min(cands))
print([a(n) for n in range(1, 19)]) # Michael S. Branicky, Dec 29 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jean-Marc Rebert, Dec 29 2025
STATUS
approved
