Return to my Mathematics pages
Go to my home page


Repunit Primes

© Copyright 1999, Jim Loy

Note: If your WWW browser cannot display special symbols, like ² or 2 or ±, then click here for the alternative 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 Rn, is equal to (10n-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 Rn is not prime. An example is R35 which is divisible by both R5 and R7. To illustrate this, look at R6 (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:

R2 11 prime
R3 111 3x37
R5 11111 41x271
R7 1111111 239x4649
R11 11111111111 21649x513239
R13 1111111111111 53x79x265371653

Our numbers are getting fairly large, and hard to factor. R13 took about a minute for my slow computer to factor. But we still have only one prime, R2. Well, the known repunit primes are R2, R19, R23, R317, and R1031 (discovered in 1986 by H. Williams and H. Dubner). There are no more repunit primes up to R16500, 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 R19 (my programming language only had 18 digits of accuracy), R23, R317, and R1031.


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