A007809 Smallest prime with n distinct digits.
2, 13, 103, 1039, 10243, 102359, 1023467, 10234589, 102345689
Offset: 1
References
- J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 1039, p.126, Ellipses, Paris 2008. [From Lekraj Beedassy, Oct 12 2008]
Programs
-
Mathematica
Table[Module[{k=NextPrime[10^n]},While[Max[DigitCount[k]]>1,k=NextPrime[k]];k],{n,0,8}] (* Harvey P. Dale, May 27 2025 *)
-
PARI
A007809(n,p=A038378(n))={until(isprime(p),while(#Set(digits(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
Extensions
Corrected by Jud McCranie, Jan 03 2001