Definition
A repunit is an integer whose decimal representation consists entirely of the digit 1 — for example, 1, 11, 111, and 1111. The base-10 repunits are conventionally denoted R_n and given by the closed form
R_n = (10^n − 1)/9, for n ≥ 1,
so that R_n contains exactly n digits. The sequence begins 1, 11, 111, 1111, 11111, 111111, … (OEIS A002275). Repunits form a special case of repdigits, which are numbers composed of repetitions of any single digit.
Etymology and history
The term is a contraction of "repeated unit" and was coined by Albert H. Beiler in his book Recreations in the Theory of Numbers (1964; often cited as 1966). Beiler also produced an early tabulation of known factors of repunits. Although the numbers themselves were not then called repunits, base-10 repunits were studied during the nineteenth century in connection with the repeating-decimal periods of reciprocals of primes: for a prime p greater than 5, the period of the decimal expansion of 1/p equals the length of the smallest repunit divisible by p. By 1880, repunits up to R_36 had been factored. Oscar Hoppe proved R_19 prime in 1916, and Lehmer and Kraitchik independently found R_23 prime in 1929.
Generalization to other bases
The concept extends to any base b, with |b| ≥ 2, by defining
R_n^(b) = (b^n − 1)/(b − 1) = 1 + b + b² + ⋯ + b^(n−1),
which consists of n copies of the digit 1 in base-b representation. In base 2, the repunits are the Mersenne numbers M_n = 2^n − 1. Repunits can also be defined for negative bases with closely analogous properties.
Properties
- If n is composite, then R_n^(b) is composite in every base b. Consequently, a repunit can be prime only if its number of digits is prime; this is necessary but not sufficient (for instance, R_3 = 111 = 3 × 37).
- For a fixed base, the repunits satisfy the divisibility relation R_a | R_n whenever a | n, and more generally gcd(R_m, R_n) = R_gcd(m,n); the repunits of a fixed base thus form a strong divisibility sequence.
- For relatively prime n and b, at least one repunit in base b is divisible by n, a result provable via the pigeonhole principle.
- Each repunit satisfies the recurrence R_n^(b) = R_(n−1)^(b) · b + 1, and consecutive repunits in any base are relatively prime.
- Any number x is a two-digit repunit in base x − 1.
- The Goormaghtigh conjecture states that 31 and 8191 are the only numbers that are repunits with at least three digits in more than one base simultaneously.
Repunit primes
A repunit prime is a repunit that is also prime. R_n is prime for n = 2, 19, 23, 317, 1031, 49081, 86453, and 109297 (OEIS A004023). Records for large probable repunit primes include R_270343, R_5794777 (2021), and R_8177207 (2021); the smaller of the large candidates, R_49081, R_86453, and R_109297, were subsequently proven prime in 2022, 2023, and 2025 respectively. It is conjectured, but not proven, that infinitely many repunit primes exist. Because their digits are all identical, repunit primes are also palindromic primes and circular primes. The base-2 repunit primes correspond to the Mersenne primes.
Related concepts
The squares of base-10 repunits yield the "wonderful Demlo numbers," such as 11² = 121 and 111² = 12321, studied by D. R. Kaprekar and named after Demlo railway station (now Dombivli) in India. Generalized repunits, prime-factorization tables of repunits, and repunits in bases 2, 3, 5, 6, 7, 10, 11, and 12 are documented in the Cunningham project and in standard references on prime number records.
References
- Beiler, Albert H., Recreations in the Theory of Numbers: The Queen of Mathematics Entertains, Dover, 1964/1966.
- Weisstein, Eric W., "Repunit," MathWorld.
- "Repunit," Wikipedia.
- Caldwell, Chris, "repunit," The Prime Glossary, Prime Pages.
- Ribenboim, Paulo, The New Book of Prime Number Records, Springer, 1996.
- On-Line Encyclopedia of Integer Sequences, sequences A002275 and A004023.