%I #9 Jan 17 2019 02:52:55
%S 137,173,317,1373,1733,3137,3371,7331,11173,11317,11731,13171,13177,
%T 13337,13711,17137,17317,17333,17377,17713,17737,31177,31337,31771,
%U 33317,33713,37117,37171,37313,37717,71317,71333,71713,73133,73331
%N Primes p such that p's set of distinct digits is {1,3,7}.
%H Robert Israel, <a href="/A108382/b108382.txt">Table of n, a(n) for n = 1..10000</a>
%p S1[1] := {1}: S3[1]:= {3}: S7[1]:= {7}:
%p S13[1]:= {}: S17[1]:= {}: S37[1]:={}:
%p S137[1]:= {}:
%p for n from 2 to 5 do
%p S1[n]:= map(t -> 10*t+1, S1[n-1]);
%p S3[n]:= map(t -> 10*t+3, S3[n-1]);
%p S7[n]:= map(t -> 10*t+7, S7[n-1]);
%p S13[n]:= map(t -> 10*t+1, S13[n-1] union S3[n-1]) union
%p map(t -> 10*t+3, S13[n-1] union S1[n-1]);
%p S17[n]:= map(t -> 10*t+1, S17[n-1] union S7[n-1]) union
%p map(t -> 10*t+7, S17[n-1] union S1[n-1]);
%p S37[n]:= map(t -> 10*t+3, S37[n-1] union S7[n-1]) union
%p map(t -> 10*t+7, S37[n-1] union S3[n-1]);
%p S137[n]:= map(t -> 10*t+1, S137[n-1] union S37[n-1]) union
%p map(t -> 10*t+3, S137[n-1] union S17[n-1]) union
%p map(t -> 10*t+7, S137[n-1] union S13[n-1]);
%p od:
%p sort(convert(`union`(seq(select(isprime,S137[n]),n=3..5)),list)); # _Robert Israel_, Jan 16 2019
%t Select[Prime[Range[7300]],Union[IntegerDigits[#]]=={1,3,7}&] (* _Harvey P. Dale_, Jun 11 2013 *)
%Y Cf. A108383 ({1, 3, 9}), A108384 ({1, 7, 9}), A108385 ({3, 7, 9}), A108386 ({1, 3, 7, 9}), A030096 (Primes whose digits are all odd).
%K base,nonn
%O 1,1
%A _Rick L. Shepherd_, Jun 01 2005