A050288 Pandigital primes.
10123457689, 10123465789, 10123465897, 10123485679, 10123485769, 10123496857, 10123547869, 10123548679, 10123568947, 10123578649, 10123586947, 10123598467, 10123654789, 10123684759, 10123685749, 10123694857, 10123746859, 10123784569, 10123846597, 10123849657, 10123854679
Offset: 1
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000.
- Eric Weisstein's World of Mathematics, "Pandigital Number".
Crossrefs
Cf. A050278.
Programs
-
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 *)
-
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
Formula
a(n) ~ n log n. - Charles R Greathouse IV, Sep 14 2012
Comments