Least prime that removing the first and last digit in base $2$ for $n$ iterations is prime each time.

158 Views Asked by At

Let us consider a sequence, $a_n$, which represents the smallest prime number such that removing its first and last digits in base $2$ (including leading zeros) for $n$ iterations will stay prime for each iteration. For example, $a_5 = 2143$. To show this, let's define a function $C_k(n)$ which will return $n$ after removing the first and last $k$ digits (including zeros) in base 2. Now we continue. $$\begin{split} C_1(2143) & = C_1(100001011111_2) = 101111_2 = 47 \text{ is prime.} \\ C_2(2143) & = C_2(100001011111_2) = 10111_2 = 23 \text{ is prime.} \\ C_3(2143) & = C_3(100001011111_2) = 1011_2 = 11 \text{ is prime.} \\ C_4(2143) & = C_4(100001011111_2) = 101_2 = 5 \text{ is prime.} \\ C_5(2143) & = C_5(100001011111_2) = 10_2 = 2 \text{ is prime.} \end{split}$$ $a_n$ thus begins $$a_n = 13, 43, 151, 2143, 2143, 12479, 57727, \dots \text{ for } n = 1,2,3,4,5,6,7, \dots$$ I have been able to find a lower bound of $a_n \ge 2\cdot4^n + 3\cdot2^n - 1$, but it seems to begin to stray away from this for larger $n$. Right now, the method I am using to find new members of the sequence is to check each prime number starting at the lower bound. Is there a more efficient way to search through the primes? Is there a lower bound that more closely fits the sequence for larger numbers? Is there an upper bound?