1

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$?

sam wolfe
  • 3,335
  • 3
    A question that is more easily answered is: when is a repunit not a prime number. For example when $n$ is even then it will be divisible by $11$ so these are out. Not much harder to see that if $n$ is not a prime then it cannot be a prime. – Winther Sep 17 '19 at 00:57
  • 3
    OEIS has an entry for these: https://oeis.org/A004023 . You'll probably find out a lot about the problem if you follow the references there. I conjecture that it's not known whether there are infinitely many primes of this sort. – xyzzyz Sep 17 '19 at 01:02
  • 1

1 Answers1

3

$\underbrace{1.....1}_\text{$a \cdot b$ $1$s}$ for some integers a,b

then,

$\underbrace{1.....1}_\text{$a$ $1$s}\underbrace{1.....1}_\text{$a$ $1$s}...\underbrace{1.....1}_\text{$a$ $1$s} $ / $ \underbrace{1.....1}_\text{$a$ $1$s} = integer$