Return to my Mathematics pages
Go to my home page


Repunit Primes

© Copyright 1999, Jim Loy

Note: This is the alternative Repunit Primes page, for WWW browser which cannot display special symbols. In particular, I am using ^2 for "squared" and +- for "plus or minus" in this version. Please let me know if this is working for you or not, by sending me email. Return to the primary Repunit Primes page.

A repunit is a number which is a series of ones (such as 11 or 11111). Such a number depends on the base that you are using. I will concentrate on base 10 in this article. In base 10, a repunit of n ones, called R(n), is equal to (10^n-1)/9. Such numbers might seem to be a good source of prime numbers.

Of course repeated digits other than one (called repdigits) cannot be prime. 777... is divisible by 7, for example. With repunits, it is easy to show that if n (the number of digits) is not prime, then R(n) is not prime. An example is R(35) which is divisible by both R(5) and R(7). To illustrate this, look at R(6) (111111). Besides being divisible by 3, it is equal to 10101x11 and also 1001x111.

Let's try a few repunits, and see if they are prime:

  R(2)             11  prime
  R(3)            111  3x37
  R(5)          11111  41x271
  R(7)        1111111  239x4649
  R(11)   11111111111  21649x513239
  R(13) 1111111111111  53x79x265371653

Our numbers are getting fairly large, and hard to factor. R(13) took about a minute for my slow computer to factor. But we still have only one prime, R(2). Well, the known repunit primes are R(2), R(19), R(23), R(317), and R(1031) (discovered in 1986 by H. Williams and H. Dubner). There are no more repunit primes up to R(16500), which is not a prime.

I experimented with these, several years ago. But I did not know that they were called repunits. I just learned that, today. I also did not know about R(19) (my programming language only had 18 digits of accuracy), R(23), R(317), and R(1031).


Addendum:

Let's square a few repunits:

 n      repunit  squared
 1            1  1
 2           11  121
 3          111  12321
 4         1111  1234321
 5        11111  123454321
 6       111111  12345654321
 7      1111111  1234567654321
 8     11111111  123456787654321
 9    111111111  12345678987654321
10   1111111111  1234567900987654321
11  11111111111  123456790120987654321

As you can see, the carries start messing up the nice pattern that was developing. What is 1/81? It is .012345679 012345... I mentioned that because 1/9=.111111... and 1/81 is 1/9 squared. So we get a pattern similar to the table above. What is 1111111 x 11111111111? It is 12345677777654321. If you showed me this number, I would know that one factor is R(7) and the other is R(11) as 11 is the number of digits-7+1. If I had memorized the repunit factor table, at the top, I could have amazed everybody by factoring 12345677777654321 into 239 x 4649 x 21649 x 513239. But there are repunits that I cannot readily factor down to primes.

Let's factor R(10). R(10)=1111111111. 11 (prime) is a factor, as is 11111 (41x271 from the table). We divide R(10) by 11 and the result of that by 11111, and we get 9091. My computer tells me that 9091 is prime. Without a computer, it would be fairly easy (but tedious) to divide 9091 by the primes less than 100, to find that it is prime. Anyway, R(10)=11 x 41 x 271 x 9091. This was easier than factoring other 10-digit numbers, because we can see right away that 11 and 11111 are factors.


Return to my Mathematics pages
Go to my home page