login
Smallest n-digit prime containing only the digits 7 and 8, or 0 if no such prime exists.
1

%I #18 Mar 09 2020 12:27:22

%S 7,0,787,7877,78787,777787,7778777,77778887,777788887,7777778887,

%T 77777778887,777777777877,7777777787777,77777777778787,

%U 777777777777787,7777777778788777,77777777777778887,777777777787878887

%N Smallest n-digit prime containing only the digits 7 and 8, or 0 if no such prime exists.

%H Jinyuan Wang, <a href="/A036949/b036949.txt">Table of n, a(n) for n = 1..500</a>

%t Table[SelectFirst[FromDigits/@Tuples[{7,8},n],PrimeQ],{n,18}]/.Missing[ "NotFound"]->0 (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Oct 07 2018 *)

%Y Cf. A020470, A036229, A036323.

%K nonn,base

%O 1,1

%A _Patrick De Geest_, Jan 04 1999