login
n-th n-digit prime number.
4

%I #24 Jun 17 2021 09:14:43

%S 2,13,107,1021,10061,100069,1000117,10000189,100000193,1000000181,

%T 10000000259,100000000193,1000000000303,10000000000411,

%U 100000000000487,1000000000000513,10000000000000931,100000000000000591,1000000000000000861,10000000000000000667

%N n-th n-digit prime number.

%H Eduard Roure Perdices, <a href="/A069100/b069100.txt">Table of n, a(n) for n = 1..1000</a>

%t a[n_] := NextPrime[10^(n - 1), n]; (* _Eduard Roure Perdices_, May 17 2021 *)

%o (PARI) a(n)=prime(primepi(10^(n-1))+n) \\ _Franklin T. Adams-Watters_, Mar 07 2014

%o (Python)

%o from sympy import nextprime

%o def a(n): return nextprime(10**(n-1), ith=n)

%o print([a(n) for n in range(1, 21)]) # _Michael S. Branicky_, Jun 16 2021

%Y Cf. A003617, A107108, A107109.

%K nonn,base

%O 1,1

%A _Darrell Minor_, Apr 05 2002

%E More terms from _Vladeta Jovovic_, Apr 07 2002

%E Extended by _Eduard Roure Perdices_, May 17 2021