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

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A071362 Smallest n-digit prime with strictly increasing digits. 7

%I

%S 2,13,127,1237,12347,123457,1234789,12356789

%N Smallest n-digit prime with strictly increasing digits.

%o (PARI) A071362(n, u=vectorv(n, i, 10^(n-i)))=forvec(d=vector(n, i, [1, 9]), isprime(d*u)&&return(d*u), 2) \\ _M. F. Hasler_, May 04 2017

%o (Python)

%o from sympy import nextprime

%o def inc(n):

%o s = str(n); return len(s)==1 or all(d>pd for pd, d in zip(s[:-1], s[1:]))

%o def a(n):

%o p = nextprime(10**(n-1))

%o while not inc(p): p = nextprime(p)

%o return p

%o for n in range(1, 9):

%o print(a(n), end=", ") # _Michael S. Branicky_, Feb 13 2021

%Y Cf. A071363, A071360, A071361, A007809.

%K base,fini,full,nonn

%O 1,1

%A _Rick L. Shepherd_, May 21 2002

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.

Last modified August 7 23:50 EDT 2022. Contains 355995 sequences. (Running on oeis4.)