OFFSET
1,1
MATHEMATICA
Union[ Flatten[ Table[ Select[ Sort[ FromDigits /@ Join[ Permutations[ Flatten[{8, Table[1, {n}]}]], Permutations[ Flatten[{2, 4, Table[1, {n - 1}]}]], Permutations[ Flatten[{2, 2, 2, Table[1, {n - 2}]}] ]]], PrimeQ[ # ] & ], {n, 0, 7}]]]
Select[Prime[Range[3 10^6]], Times@@IntegerDigits[#] == 8 &] (* Vincenzo Librandi, Jul 27 2016 *)
PROG
(Magma) [p: p in PrimesUpTo(3*10^7) | &*Intseq(p) eq 8]; // Vincenzo Librandi, Jul 27 2016
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Zak Seidov and Robert G. Wilson v, May 20 2005
STATUS
approved