OFFSET
1,1
COMMENTS
It is conjectured that such a prime always exists.
a(2), a(19), a(23), etc. are the prime repunits (A004023). a(1000) = (10^n-1)/9 + 111011000010.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..1000 (terms n=1..400 from Alois P. Heinz)
Robert G. Wilson v, Comments and first 100 terms
MATHEMATICA
Do[p = (10^n - 1)/9; k = 0; While[ ! PrimeQ[p], k++; p = FromDigits[ PadLeft[ IntegerDigits[ k, 2], n] + 1]]; Print[p], {n, 1, 20}]
Table[Min[Select[ FromDigits/@Tuples[{1, 2}, n], PrimeQ]], {n, 20}] (* Harvey P. Dale, Feb 05 2014 *)
PROG
(Python)
from sympy import isprime
def A036229(n):
k, r, m = (10**n-1)//9, 2**n-1, 0
while m <= r:
t = k+int(bin(m)[2:])
if isprime(t):
return t
m += 1
return -1 # Chai Wah Wu, Aug 18 2021
CROSSREFS
KEYWORD
nonn,base,nice
AUTHOR
EXTENSIONS
Edited by N. J. A. Sloane and Robert G. Wilson v, May 03 2002
Escape clause added by Chai Wah Wu, Aug 18 2021
STATUS
approved