Consider the numbers of the form $$ a_n=\lfloor\pi\times 10^{n-1} \rfloor, $$ for $n\in\mathbb{N}$. In other words, $\{a_n\}_{n\in\mathbb{N}}$ is the sequence composed of integers built from the first $n$ digits of $\pi$, so that $$ a_1=3,\,\,\,a_2=31,\,\,\,a_3=314,\,\,\,a_4=3141,\,\,\,a_5=31415,\,\,\,... $$ My question is: for which values of $n$ is $a_n$ a prime number?
I wrote a small code to find primes for $1\leq n\leq 10^4$, and I've only found primes for $n\in\{1,2,6,38\}$, which are, respectively, \begin{align} a_1&=3\\ a_2&=31\\ a_6&=314159\\ a_{38}&=31415926535897932384626433832795028841 \end{align} I found this result rather intriguing, since I'd expect to find more primes up to numbers with $10^4$ digits. Are there any more primes in this sequence? Is there an explanation for the lack of primes between $a_{38}$ and $a_{10^4}$?
This is not so few. If we take the probability that a number $n$ is prime to be $1/\log(n)$, we would expect $\sum \frac 1{n \log (10)}\approx \frac 1{2.3}(\log(n)+\gamma)$ of them out to $n$. If we do the sum from $2$ to $10^4$ it is $3.8$ while we have $3$ and if we do it out to $16208$ we should have $4$ and we do. The sum diverges, so we should have infinitely many, but it diverges very slowly.