OFFSET
1,1
COMMENTS
There are exactly 510 four-digit primes with all distinct digits. The end of the sequence is: 8761, 8923, 8941, 8951, 8963, 8971, 9013, 9041, 9043, 9067, 9103, 9127, 9137, 9157, 9173, 9187, 9203, 9241, 9257, 9281, 9283, 9341, 9371, 9403, 9413, 9421, 9431, 9437, 9461, 9463, 9467, 9473, 9521, 9547, 9587, 9601, 9613, 9623, 9631, 9643, 9721, 9743, 9781, 9803, 9817, 9851, 9857, 9871.
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..510 (full sequence)
EXAMPLE
a(1) = 1039 and a(510) = 9871 because these are the first and the last four-digit primes with all distinct digits.
MATHEMATICA
Select[Range[1001, 9999, 2], Length[Union[IntegerDigits[#]]] == 4 && PrimeQ[#] &] (* Corrected by Harvey P. Dale, Jan 17 2011 *)
Select[Prime[Range[168, 1229]], Max[DigitCount[#]]==1&] (* Harvey P. Dale, Aug 22 2019 *)
PROG
(PARI) is(n)=isprime(n) && #digits(n)==4 && #Set(digits(n))==4 \\ Charles R Greathouse IV, Feb 11 2017
CROSSREFS
KEYWORD
fini,full,nonn,base
AUTHOR
Zak Seidov, Aug 30 2002
STATUS
approved