OFFSET
1,1
LINKS
Chris Caldwell, The First 1,000 Primes
EXAMPLE
The difference between the largest digit (7) and the smallest digit (1) in the prime 167 is also in the same prime. The difference between the largest digit (9) and the smallest digit (0) in the prime 409 is also in the same prime. The difference between the largest digit (8) and the smallest digit (3) in the prime 853 is also in the same prime.
MATHEMATICA
ss={}; Do[id=IntegerDigits[p=Prime[n]]; If[MemberQ[id, Max[id]-Min[id]], AppendTo[ss, p]], {n, 2000}]; ss (* Zak Seidov, Aug 24 2009 *)
fQ[n_] := Block[{id = Union@ IntegerDigits@ n}, MemberQ[id, id[[ -1]] - id[[1]] ]]; Select[ Prime@ Range@ 185, fQ@# &] (* Robert G. Wilson v, Aug 24 2009 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Parthasarathy Nambi, Aug 23 2009
EXTENSIONS
Edited by N. J. A. Sloane, Aug 24 2009
Sequence corrected and extended by Zak Seidov and Robert G. Wilson v, Aug 24 2009
STATUS
approved