login
A036939
Smallest n-digit prime containing only digits 2 and 9, or 0 if no such prime exists.
1
2, 29, 229, 2999, 22229, 0, 2222929, 22229299, 222229229, 2222229299, 22222229299, 0, 2222222229229, 22222222222229, 222222222229229, 2222222222229299, 22222222222922299, 0, 2222222222222292929
OFFSET
1,1
COMMENTS
a(6k) = 0 as any 6k-digit number containing only digits 2 or 9 is divisible by 7. - Jinyuan Wang, Mar 09 2020
LINKS
MATHEMATICA
Join[{2}, Table[Min[Select[FromDigits/@(Join[#, {9}]&/@Tuples[{2, 9}, n]), IntegerLength[#]==n+1&&PrimeQ[#]&]], {n, 20}]]/.\[Infinity]->0 (* Harvey P. Dale, Nov 08 2011 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Jan 04 1999
STATUS
approved