Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #9 Sep 08 2022 08:46:13
%S 3,5,53,83,353,383,853,883,3533,3583,3833,3853,5333,8353,33353,33533,
%T 35353,35533,38333,38833,53353,55333,83383,83833,85333,85853,88853,
%U 88883,333383,333533,335383,335833,338383,353333,353833,355853,383533,383833,533353
%N Primes that contain only the digits (3, 5, 8).
%C A020462 and A020464 are subsequences.
%H Alois P. Heinz, <a href="/A260226/b260226.txt">Table of n, a(n) for n = 1..10000</a>
%t Select[Prime[Range[5 10^4]], Complement[IntegerDigits[#], {3, 5, 8}]=={} &]
%t Select[Flatten[Table[FromDigits/@Tuples[{3,5,8},n],{n,6}]],PrimeQ] (* or *) Join[{3,5},Select[10#+3&/@Flatten[Table[FromDigits/@Tuples[{3,5,8},n],{n,5}]],PrimeQ]] (* The second program is faster because it recognizes that, except only for 5, each such prime must end in 3. *) (* _Harvey P. Dale_, Jul 17 2020 *)
%o (Magma) [p: p in PrimesUpTo(2*10^6) | Set(Intseq(p)) subset [3, 5, 8]];
%Y Cf. similar sequences listed in A260223.
%Y Cf. A020462, A020464.
%K nonn,easy,base
%O 1,1
%A _Vincenzo Librandi_, Jul 22 2015