A repunit (“repeated unit”) is a number that only contains the digit 1 in some number base. For example, 31 is a repunit in base 5 and base 2, because 31 is written as 111 (25+5+1) in base 5, and as 11111 (16+8+4+2+1) in base 2. Another number that is a repunit in two different bases is 8191, which is 111 in base 90 and 1111111111111 in base 2.
A number is a repunit in base 2 if and only if it is of the form 2n – 1. Numbers of this form are known as Mersenne numbers, and a Mersenne prime is a Mersenne number that is also a prime. It can be shown that if n is a multiple of r, then 2n – 1 is a multiple of 2r – 1. It follows that 23 – 1 and 25 – 1 are both factors of 215 – 1, because 3 and 5 are factors of 15. This implies that in order for 2n – 1 to be prime, it is necessary for n itself to be prime.
The numbers 31=25 – 1 and 8191=213 – 1 are both Mersenne primes, but it is rare for a number of the form 2p – 1 to be prime, even if p is prime. For example, 211 – 1 is not prime even though 11 is prime, because 2047=23×89. Although there are only 52 known examples of Mersenne primes, these examples include the seven largest primes currently known. The graph above shows the number of digits in the largest known Mersenne prime plotted by year. The largest prime known at the time of writing is the 41024320 digit Mersenne prime 2136279841– 1, which was discovered by Luke Durant on October 12, 2024.
An interesting property of Mersenne primes is their relationship with perfect numbers. A number is called perfect if it is the sum of its divisors, excluding the number itself. For example 6=1+2+3 is perfect, as is 28=1+2+4+7+14. It is a theorem that each Mersenne prime 2p – 1 has a corresponding perfect number 2p-1(2p – 1). For example, the first three Mersenne primes, 3=22 – 1, 7=23 – 1, and 31=25 – 1 correspond to the perfect numbers 6=22-1(22 – 1), 28=23-1(23 – 1), and 496=25-1(25 – 1). It is not known whether any odd perfect numbers exist, but it is known that any such number would need to have over 1500 digits.
It is conjectured that there are infinitely many Mersenne primes. Another conjecture that involves repunits is the Goormaghtigh conjecture, which is the hypothesis that 31 and 8191 are the only numbers that can be written as repunits with at least 3 digits in two different bases. A string of m ones in base x represents the number (xm – 1)/(x – 1), so an equivalent way to state the conjecture is that the only solutions to the equation N = (xm – 1)/(x – 1)=(yn – 1)/(y – 1) with y > x ≥ 2 and n > m > 2 are N=31 and N=8191. The conjecture excludes repunits of length 2 because any integer N ≥ 3 can be written as 11 in base N – 1.
I found out about the Goormaghtigh conjecture from the recent paper No new Goormaghtigh primes up to 10700 by Jon Grantham, which proves that any prime number N that satisfies the Goormaghtigh conjecture must have over 700 digits. Grantham also proves that the number of solutions to the Goormaghtigh conjecture can be shown to be finite, assuming that the abc conjecture is true. Unfortunately, the abc conjecture is a major unsolved problem in number theory: a proof of the abc conjecture would immediately solve many other problems in mathematics, and would potentially give a very short proof of Fermat’s Last Theorem.
Picture credits and relevant links
The graph of the Mersenne prime records is by Nicoguaro and appears on Wikipedia. The other graphics are my own work.
The Goormaghtigh conjecture was proposed by the engineer René Goormaghtigh in 1917.
Wikipedia has entries on repunits, Mersenne primes, perfect numbers, the Great Internet Mersenne Prime Search, and the abc conjecture.
Sequence A000043 of the On-Line Encyclopedia of Integer Sequences lists the known values of p for which 2p – 1 is prime.
I thank Jeff Heiges for some useful conversations about Mersenne primes.
Substack management by Buzz & Hum.
Interesting post (as always). There is something ever so slightly funky to me that perfect numbers include 1 since 1 seems often ignored as a factor. But the alternate definition, the prime being half the sum of *all* its factors, doesn't seem as "perfect".
Dr. Green, Thanks for the number theory that is completely new to me. One always wants to ask the question, "Why?" there are so few numbers that fall into these unusual categories. I suppose there is a desire to find patterns and sometimes patterns are either nonexistent or more complex than can be discovered.