OFFSET
1,1
COMMENTS
Digits may appear multiple times; density n/log n (almost all primes are pandigital).
Note that actually a(n) is much larger than n*log(n) (see Formula section). Even for n = 10000, a(n) = 111571*n*log(n). - Zak Seidov, Jul 27 2014
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000.
Eric Weisstein's World of Mathematics, "Pandigital Number".
FORMULA
a(n) ~ n log n. - Charles R Greathouse IV, Sep 14 2012
MATHEMATICA
ta={{0}}; Do[u=Union[IntegerDigits[n]]; If[Equal[u, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}]&&PrimeQ[n], ta=Append[ta, n]], {n, 10123456789, 20000000000}]; ta (* Labos Elemer *)
PROG
(PARI) is(n)=isprime(n) && #vecsort(digits(n), , 8)>9 \\ Charles R Greathouse IV, May 04 2013
(Python)
from sympy import isprime
from itertools import count, islice, product
def agen(): # generator of terms
for d in count(11):
for f in "123456789":
for m in product("0123456789", repeat=d-2):
for e in "1379":
t = f + "".join(m) + e
if len(set(t)) == 10 and isprime(it:=int(t)):
yield it
print(list(islice(agen(), 20))) # Michael S. Branicky, Apr 09 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved