A036946 Smallest n-digit prime containing only the digits 5 and 7, or 0 if no such prime exists.
5, 0, 557, 5557, 57557, 555557, 5555777, 55555777, 555557557, 5555555557, 55555555777, 555555575557, 5555555757757, 55555555575757, 555555555555557, 5555555555557577, 55555555555777777, 555555555557557757, 5555555555555557577, 55555555555575755777
Offset: 1
Links
- Jinyuan Wang, Table of n, a(n) for n = 1..500
Programs
-
Mathematica
Flatten[Join[{5,0},Table[Select[FromDigits/@(Join[#,{7}]&/@Tuples[ {5,7},n]), PrimeQ,1],{n,2,20}]]] (* Harvey P. Dale, Mar 08 2013 *)
Extensions
More terms from Harvey P. Dale, Mar 08 2013