A036930 Smallest n-digit prime containing only digits 1 and 3, or 0 if no such prime exists.
3, 11, 113, 3313, 11113, 113111, 1111333, 11111131, 111111113, 1111113313, 11111111113, 111111133333, 1111111111333, 11111111113133, 111111111113113, 1111111111313131, 11111111111131333, 111111111111111131
Offset: 1
Links
- Jinyuan Wang, Table of n, a(n) for n = 1..500
Programs
-
Mathematica
Flatten[Table[Select[FromDigits/@Tuples[{1,3},n],PrimeQ,1],{n,18}]] (* Harvey P. Dale, Jul 23 2012 *)
Extensions
Corrected by Harvey P. Dale, Jul 23 2012