%I #10 Feb 13 2021 13:56:15
%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
|