OFFSET
1,1
COMMENTS
The Magma Calculator (http://magma.maths.usyd.edu.au/calc/) verified each of the 100 terms in the table as prime. - Jon E. Schoenfield, Aug 24 2009
Can this sequence be proved to be infinite, a sort of Dirichlet's Theorem in reverse? - Charles R Greathouse IV, Jul 23 2011
a(369) has 1002 digits. - Michael S. Branicky, Dec 29 2025
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..368 (terms 1..100 from T.D. Noe)
FORMULA
a(n) >= A007908(n). - Michael S. Branicky, Dec 29 2025
EXAMPLE
a(6) = 12345623 is the smallest prime beginning with the string 123456.
MATHEMATICA
sp[n_]:=Module[{m=1, np}, np=NextPrime[n*10^m]; While[Floor[np/10^m] != n, m++; np=NextPrime[n*10^m]]; np]; sp/@Table[FromDigits[ Flatten[ IntegerDigits/@ Range[x]]], {x, 20}] (* Harvey P. Dale, May 22 2016 *)
PROG
(Python)
from itertools import count
from gmpy2 import is_prime, mpz
def a(n):
t = int("".join(str(i) for i in range(1, n+1)))
if is_prime(t): return t
for d in count(1):
t *= 10
for i in range(1, 10**d, 2):
if is_prime(t+i):
return t+i
print([a(n) for n in range(1, 18)]) # Michael S. Branicky, Dec 29 2025
CROSSREFS
KEYWORD
base,easy,nice,nonn
AUTHOR
Enoch Haga, Jan 16 2000
STATUS
approved
