6

For which $n$ is the sum: $$\sum_{k=0}^{n}10^k$$ a prime number? Are they finite?

User
  • 8,033
  • 10
    When it is only divisible by itself and one. Boooyaa – CogitoErgoCogitoSum Feb 12 '13 at 01:52
  • 1
    @CogitoErgoCogitoSum: This is an answer to the title only. Now answer the main question! Find all $n$s! –  Feb 12 '13 at 01:53
  • @CutieKrait I did answer the question - the header question at the very least - so dont fault me. It was a joke - lighten up. Its not like I posted a formal answer below; I only posted a comment. – CogitoErgoCogitoSum Feb 12 '13 at 02:02
  • 1
    For the $n$ in OEIS A004023, minus $1$. As far as I know it is not known whether there are infinitely many. Also see Wikipedia. The $-1$ is because CutieKrait wrote down $(10^{n+1}-1)/9$ above, but OEIS chose to use $(10^n-1)/9$. Therefore the OEIS sequence starts with $2$. – David Moews Feb 12 '13 at 02:04
  • http://oeis.org/A004022 as well – Will Jagy Feb 12 '13 at 02:14

3 Answers3

19

After adding $1$, the $n$s for which the sum above is known to be prime or probably prime are given in the OEIS sequence A004023. (The $+1$ is because the OEIS lists numbers $n$ such that $(10^n-1)/9$ is prime, but the sum in the question is instead equal to $(10^{n+1}-1)/9$.) Also, see the Wikipedia article and the Prime Pages entry.

These primes are called "repunit primes" since their decimal expansion consists of a repeated series of $1$s. The repunits corresponding to $$ n=1, 18, 22, 316, \text{and } 1030 $$ $$\text{ (using the $n$ in the questioner's formula above)} $$ are known to be prime. The repunits corresponding to $$ n=49080, 86452, 109296, \text{and } 270342 $$ $$\text{ (again using the $n$ in the questioner's formula above)} $$ are as far as I know only known to be probably prime.

The obvious factorization $$ \frac{10^{km}-1}{9}=\frac{10^k-1}{9}(1+10^k+\cdots+10^{k(m-1)}) $$ means that, for $(10^{n+1}-1)/9$ to be prime, $n+1$ must also be prime.

There are conjectured to be infinitely many repunit primes.

David Moews
  • 17,341
3

Partial solution:

Given a prime $p \neq 2, 5$, let $n = Q(p - 1) + R$. We use Fermat's Little Theorem modulo $p$:

$$\begin{align} \sum_{k = 0}^n10^k &= 1 + \sum_{i = 1}^Q10^{(i - 1)(p - 1)}(10^1 + 10^2 + \dotsb + 10^{p - 1}) + 10^{Q(p - 1)}(10^1 + 10^2 + \dotsb + 10^R)\\ &\equiv 1 + \sum_{i = 1}^Q\frac{p(p - 1)}{2} + (10^1 + 10^2 + \dotsb + 10^R)\\ &\equiv \sum_{k = 0}^R10^k \pmod{p}. \end{align}$$

The $p(p - 1)/2$ came from the fact that the residues of $10^1, 10^2, \dotsc, 10^{p - 1}$ modulo $p$ form a permutation of $1, 2, \dotsc, (p - 1)$.

Herng Yi
  • 3,236
1

Numbers having the shape n = 1111......1 have less probability to be a prime.

If sum of all digits are divisible by 3 then that number is divisible by 3. Using this rule If number of digits of n is divisible by 3 then n is surely not a prime. $\therefore 111,111111,111111111, ....$ are divisible by 3

If number of digits are divisible by 2 (even number of digits in n), then n can be partitions into multiple 11s. e.g. 1111 can be partitioned as 11 11. Which is divisible by 11 $\therefore 11,1111,111111, .... $ are divisible by 11.

So if number of digits are not divisible by 2 or 3 (e.g. $5,7,11,13,17,19,23,25,29,31,35,37,....$) we are not obvious that the number is not prime. However for these numbers we get large prime divisors most of the time. Like 11111 = 41*271

Neel Basu
  • 358
  • 2
    So similarly, if the number of digits is a composite number, it can not be a prime, like 35 digits, you can partition it as 7 times of 11111, which cannot be a prime. Then the number of digits must also be a prime. – CO2 Sep 30 '22 at 08:25
  • 1
    The one in the example 11111 has 5 digits, which is prime. But the number is not prime. However 1111 is not prime in spite of having composite number of digits. – Neel Basu Oct 05 '22 at 11:35
  • 1
    Yea. You just said you can look if the number of digits is visible by 2,3. But the same argument can be extended to 5,7,11... My claim was: "if the number of digits of 111...1 is a composite number it can not be a prime." I just extended your result. Say in your list, you say is not clear for 35, but in fact it is not a prime. However, I did not say anything when the number of digits is a prime. It is not clear (in fact an open question), whether it is a prime. Even for 11 and 111, 11 is a prime but 111 is not. – CO2 Oct 11 '22 at 22:43