login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A036929
Smallest n-digit prime containing only digits 0 and 1, or 0 if no such prime exists.
6
0, 11, 101, 0, 10111, 101111, 1011001, 10010101, 100100111, 1000001011, 10000001101, 100000001111, 1000000111001, 10000000001011, 100000000100101, 1000000000011101, 10000000000001101, 100000000000100111
OFFSET
1,2
LINKS
PROG
(PARI) a(n) = for(k=2^(n-1), 2^n-1, v=binary(k); if(ispseudoprime(p=fromdigits(v)), return(p))); 0; \\ Jinyuan Wang, Mar 09 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Jan 04 1999
STATUS
approved