Consider all numbers that are written with only ones in base $10$, that is, numbers of the form
$$
p_n=\sum_{i=1}^{n} 10^{i-1}=\frac{10^n-1}{9}=\underbrace{1.....1}_\text{$n$ $1$s}.
$$
Here, $n$ is the number of $1$s in that number. For example, $p_2=11$ and $p_5=11111$.
For which values of $n$ is $p_n$ a prime number? I feel there should be an infinite number of values, but is this true? For example, after a brief computation, I've concluded that, for $1\leq n\leq 10^4 $, $p_n$ is prime if and only if
$$
n\in\{2,19,23,317,1031\},
$$
which are also prime numbers.
In some way, it seems that such primes stop here, but it might simply be the case that the next prime is way bigger than $p_{1031}$. If there are indeed infinitely many primes in such form, is there an efficient way of testing whether $p_n$ is a prime, given $n$?
No comments:
Post a Comment