A036933 Smallest n-digit prime containing only digits 1 and 6, or 0 if no such prime exists.
0, 11, 661, 6661, 11161, 111611, 1111661, 11111161, 111616111, 1111161661, 11111111611, 111111111611, 1111111111661, 11111111616611, 111111111116111, 1111111111616161, 11111111111611661, 111111111111111161
Offset: 1
Links
- Jinyuan Wang, Table of n, a(n) for n = 1..500
Programs
-
Mathematica
Join[{0},Flatten[Table[Select[Sort[FromDigits/@Tuples[{1,6},i]], PrimeQ, 1], {i,2,20}]]] (* Harvey P. Dale, May 06 2014 *)