Inrecreational mathematics, arepunit is anumber like 11, 111, or 1111 that contains only the digit1 — a more specific type ofrepdigit. The term stands for "repeated unit" and was coined in 1966 by Albert H. Beiler in his bookRecreations in the Theory of Numbers.[note 1]
Thus, the numberRn(2) consists ofn copies of the digit 1 in base-2 representation. In fact, the base-2 repunits are the well-knownMersenne numbersMn = 2n − 1, they start with
Ifp is an odd prime, then every primeq that dividesRp(b) must be either 1 plus a multiple of 2p, or a factor ofb − 1. For example, a prime factor ofR29 is 62003 = 1 + 2·29·1069. The reason is that the primep is the smallest exponent greater than 1 such thatq dividesbp − 1, becausep is prime. Therefore, unlessq dividesb − 1,p divides theCarmichael function ofq, which is even and equal toq − 1.
Any positive multiple of the repunitRn(b) contains at leastn nonzero digits in base-b.
Any numberx is a two-digit repunit in base x − 1.
The only known numbers that are repunits with at least 3 digits in more than one base simultaneously are 31 (111 in base-5, 11111 in base-2) and 8191 (111 in base-90, 1111111111111 in base-2). TheGoormaghtigh conjecture says there are only these two cases.
Using thepigeon-hole principle it can be easily shown that forrelatively prime natural numbersn andb, there exists a repunit in base-b that is a multiple ofn. To see this consider repunitsR1(b),...,Rn(b). Because there aren repunits but onlyn−1 non-zero residues modulon there exist two repunitsRi(b) andRj(b) with 1 ≤i <j ≤n such thatRi(b) andRj(b) have the same residue modulon. It follows thatRj(b) −Ri(b) has residue 0 modulon, i.e. is divisible byn. SinceRj(b) −Ri(b) consists ofj −i ones followed byi zeroes,Rj(b) −Ri(b) =Rj−i(b) ×bi. Nown divides the left-hand side of this equation, so it also divides the right-hand side, but sincen andb are relatively prime,n must divideRj−i(b).
Using theEuclidean Algorithm for repunits definition:R1(b) = 1;Rn(b) =Rn−1(b) ×b + 1, any consecutive repunitsRn−1(b) andRn(b) are relatively prime in any base-b for anyn.
Ifm andn have a common divisord,Rm(b) andRn(b) have the common divisorRd(b) in any base-b for anym andn. That is, the repunits of a fixed base form astrong divisibility sequence. As a consequence, Ifm andn are relatively prime,Rm(b) andRn(b) are relatively prime. The Euclidean Algorithm is based ongcd(m,n) =gcd(m −n,n) form >n. Similarly, usingRm(b) −Rn(b) ×bm−n =Rm−n(b), it can be easily shown thatgcd(Rm(b),Rn(b)) =gcd(Rm−n(b),Rn(b)) form >n. Therefore, ifgcd(m,n) =d, thengcd(Rm(b),Rn(b)) =Rd(b).
Factorization of decimal repunits
(Prime factors (or prime powers) parenthesized and colored(red) are "new factors", i. e. the prime factor (or power) dividesRn but does not divideRk for allk <n) (sequenceA102380 in theOEIS)[2]
which has the expected form of a repunit whenx is substituted withb.
For example, 9 is divisible by 3, and thusR9 is divisible byR3—in fact, 111111111 = 111 · 1001001. The corresponding cyclotomic polynomials and are and, respectively. Thus, forRn to be prime,n must necessarily be prime, but it is not sufficient forn to be prime. For example,R3 = 111 = 3 · 37 is not prime. Except for this case ofR3,p can only divideRn for primen ifp = 2kn + 1 for somek.
Decimal repunit primes
Rn is prime forn = 2, 19, 23, 317, 1031, 49081, 86453, 109297 ... (sequenceA004023 inOEIS). On July 15, 2007, Maksym Voznyy announcedR270343 to be probably prime.[3] Serge Batalov and Ryan Propper foundR5794777 andR8177207 to be probable primes on April 20 and May 8, 2021, respectively.[4] As of their discovery, each was the largest known probable prime. On March 22, 2022, probable primeR49081 was eventually proven to be a prime.[5] On May 15, 2023, probable primeR86453 was eventually proven to be a prime.[6] On May 26, 2025, probable primeR109297 was eventually proven to be a prime.[7]
It has been conjectured that there are infinitely many repunit primes[8] and they seem to occur roughly as often as theprime number theorem would predict: the exponent of theNth repunit prime is generally around a fixed multiple of the exponent of the (N−1)th.
The prime repunits are a trivial subset of thepermutable primes, i.e., primes that remain prime after anypermutation of their digits.
Particular properties are
The remainder ofRn modulo 3 is equal to the remainder ofn modulo 3. Using 10a ≡ 1 (mod 3) for anya ≥ 0, n ≡ 0 (mod 3) ⇔Rn ≡ 0 (mod 3) ⇔Rn ≡ 0 (modR3), n ≡ 1 (mod 3) ⇔Rn ≡ 1 (mod 3) ⇔Rn ≡R1 ≡ 1 (modR3), n ≡ 2 (mod 3) ⇔Rn ≡ 2 (mod 3) ⇔Rn ≡R2 ≡ 11 (modR3). Therefore, 3 |n ⇔ 3 |Rn ⇔R3 |Rn.
The remainder ofRn modulo 9 is equal to the remainder ofn modulo 9. Using 10a ≡ 1 (mod 9) for anya ≥ 0, n ≡r (mod 9) ⇔Rn ≡r (mod 9) ⇔Rn ≡Rr (modR9), for 0 ≤r < 9. Therefore, 9 |n ⇔ 9 |Rn ⇔R9 |Rn.
Algebra factorization of generalized repunit numbers
Ifb is aperfect power (can be written asmn, withm,n integers,n > 1) differs from 1, then there is at most one repunit in base-b. Ifn is aprime power (can be written aspr, withp prime,r integer,p,r >0), then all repunit in base-b are not prime aside fromRp andR2.Rp can be either prime or composite, the former examples,b = −216, −128, 4, 8, 16, 27, 36, 100, 128, 256, etc., the latter examples,b = −243, −125, −64, −32, −27, −8, 9, 25, 32, 49, 81, 121, 125, 144, 169, 196, 216, 225, 243, 289, etc., andR2 can be prime (whenp differs from 2) only ifb is negative, a power of −2, for example,b = −8, −32, −128, −8192, etc., in fact, theR2 can also be composite, for example,b = −512, −2048, −32768, etc. Ifn is not a prime power, then no base-b repunit prime exists, for example,b = 64, 729 (withn = 6),b = 1024 (withn = 10), andb = −1 or 0 (withn any natural number). Another special situation isb = −4k4, withk positive integer, which has theaurifeuillean factorization, for example,b = −4 (withk = 1, thenR2 andR3 are primes), andb = −64, −324, −1024, −2500, −5184, ... (withk = 2, 3, 4, 5, 6, ...), then no base-b repunit prime exists. It is also conjectured that whenb is neither a perfect power nor −4k4 withk positive integer, then there are infinity many base-b repunit primes.
The generalized repunit conjecture
A conjecture related to the generalized repunit primes:[9][10] (the conjecture predicts where is the nextgeneralized Mersenne prime, if the conjecture is true, then there are infinitely many repunit primes for all bases)
For any integer, which satisfies the conditions:
.
is not aperfect power. (since when is a perfectth power, it can be shown that there is at most one value such that is prime, and this value is itself or aroot of)
is theth generalized repunit prime in baseb (with primep)
is a data fit constant which varies with.
if, if.
is the largest natural number such that is ath power.
We also have the following 3 properties:
The number of prime numbers of the form (with prime) less than or equal to is about.
The expected number of prime numbers of the form with prime between and is about.
The probability that number of the form is prime (for prime) is about.
History
Although they were not then known by that name, repunits in base-10 were studied by many mathematicians during the nineteenth century in an effort to work out and predict the cyclic patterns ofrepeating decimals.[11]
It was found very early on that for any primep greater than 5, theperiod of the decimal expansion of 1/p is equal to the length of the smallest repunit number that is divisible byp. Tables of the period of reciprocal of primes up to 60,000 had been published by 1860 and permitted thefactorization by such mathematicians as Reuschle of all repunits up toR16 and many larger ones. By 1880, evenR17 toR36 had been factored[11] and it is curious that, thoughÉdouard Lucas showed no prime below three million had periodnineteen, there was no attempt to test any repunit for primality until early in the twentieth century. The American mathematician Oscar Hoppe provedR19 to be prime in 1916,[12] and Lehmer and Kraitchik independently foundR23 to be prime in 1929.
Further advances in the study of repunits did not occur until the 1960s, when computers allowed many new factors of repunits to be found and the gaps in earlier tables of prime periods corrected.R317 was found to be aprobable prime circa 1966 and was proved prime eleven years later, whenR1031 was shown to be the only further possible prime repunit with fewer than ten thousand digits. It was proven prime in 1986, but searches for further prime repunits in the following decade consistently failed. However, there was a major side-development in the field of generalized repunits, which produced a large number of new primes and probable primes.
Since 1999, four further probably prime repunits have been found, but it is unlikely that any of them will be proven prime in the foreseeable future because of their huge size.
TheCunningham project endeavours to document the integer factorizations of (among other numbers) the repunits to base 2, 3, 5, 6, 7, 10, 11, and 12.
Demlo numbers
D. R. Kaprekar has defined Demlo numbers as concatenation of a left, middle and right part, where the left and right part must be of the same length (up to a possible leading zero to the left) and must add up to a repdigit number, and the middle part may contain any additional number of this repeated digit.[13] They are named afterDemlo railway station (now calledDombivili) 30 miles from Bombay on the thenG.I.P. Railway, where Kaprekar started investigating them.He callsWonderful Demlo numbers those of the form 1, 121, 12321, 1234321, ..., 12345678987654321. The fact that these are the squares of the repunits has led some authors to call Demlo numbers the infinite sequence of these,[14] 1, 121, 12321, ..., 12345678987654321, 1234567900987654321, 123456790120987654321, ..., (sequenceA002477 in theOEIS), although one can check these are not Demlo numbers forp = 10, 19, 28, ...
^Albert H. Beiler coined the term "repunit number" as follows:
A number which consists of a repeated of a single digit is sometimes called a monodigit number, and for convenience the author has used the term "repunit number" (repeated unit) to represent monodigit numbers consisting solely of the digit 1.[1]