login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A007809
Smallest prime with n distinct digits.
12
2, 13, 103, 1039, 10243, 102359, 1023467, 10234589, 102345689
OFFSET
1,1
REFERENCES
J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 1039, p.126, Ellipses, Paris 2008. [From Lekraj Beedassy, Oct 12 2008]
PROG
(PARI) A007809(n, p=A038378(n))={until(isprime(p), while(#Set(digits(p++))<n, )); p} \\ M. F. Hasler, May 04 2017
(Python)
from sympy import nextprime
def a(n):
p = nextprime(10**(n-1))
while len(set(str(p))) < n: p = nextprime(p)
return p
for n in range(1, 10):
print(a(n), end=", ") # Michael S. Branicky, Feb 13 2021
CROSSREFS
KEYWORD
nonn,fini,base,full
AUTHOR
N.B. Backhouse (sx52(AT)liverpool.ac.uk)
EXTENSIONS
Corrected by Jud McCranie, Jan 03 2001
STATUS
approved