Introduction
A number made entirely from repeated 1s looks simple: 1, 11, 111, and so on. Yet these numbers, called repunits, have useful patterns involving divisibility, prime numbers, and repeating decimals. Their appeal comes from a neat combination: each one is easy to write down, but its factors can reveal surprisingly rich mathematical structure.
What is a repunit?
A repunit is a number whose digits are all 1 in a particular number base. In everyday decimal notation, the first few are 1, 11, 111, 1,111, and 11,111. The name combines “repeated” and “unit,” referring to the repeated digit 1.
There is a compact formula for a decimal repunit with n digits:
Rn = (10n − 1) / 9
For example, putting n = 4 gives (104 − 1) / 9 = 9,999 / 9 = 1,111. The formula works because subtracting 1 from a power of 10 produces a row of 9s, and dividing that row by 9 produces a row of 1s.
The symbol Rn is simply a convenient way to refer to the repunit with n digits. Thus R1 = 1, R2 = 11, and R6 = 111,111. It also gives a way to discuss very long repunits without writing out every digit.
Why repeated 1s have a formula
A repunit can also be expressed as a sum of powers of 10. For instance, 1,111 is 1,000 + 100 + 10 + 1. In general:
Rn = 10n−1 + 10n−2 + … + 10 + 1
This is a geometric series: each term is ten times the term after it. The standard formula for the sum of such a series gives (10n − 1) / 9. Seeing a repunit as a sum helps explain why it can be divided into useful groups and why powers of 10 appear in its properties.
The pattern is not limited to decimal notation. In base b, where b is an integer greater than 1, the number with n copies of the digit 1 is (bn − 1) / (b − 1). For example, the binary numeral 1111 represents 15 in decimal, because its place values are 8, 4, 2, and 1. It is a four-digit repunit in base 2, even though it is not a decimal repunit.
When discussing repunits, it is important to specify the base if there is any possibility of confusion. The properties of repeated 1s depend partly on the base in which they are written.
Simple divisibility patterns
Because every decimal repunit has a digit sum equal to its length, familiar divisibility tests immediately reveal some factors. A number is divisible by 3 when its digits add to a multiple of 3. Therefore, Rn is divisible by 3 whenever n is divisible by 3. For example, 111 has digit sum 3, and 1,111,111,111 has digit sum 10, so the first is divisible by 3 while the second is not.
The same reasoning works for 9: a decimal repunit is divisible by 9 when its number of digits is a multiple of 9. This is a quick test, but it does not describe every possible factor. Many repunits have factors that are not 3 or 9.
Another pattern involves 11. Since 10 leaves a remainder of −1 when divided by 11, the digits of a number can be considered in alternating groups when testing divisibility by 11. For a repunit, the alternating sum is 0 if its length is even. Consequently, every even-length decimal repunit is divisible by 11. For example, 11,111,111 has eight digits and can be divided by 11 exactly.
These rules are examples of modular arithmetic, a method of studying remainders rather than full values. Saying that 10 is congruent to −1 modulo 11 means that 10 and −1 leave the same remainder when divided by 11. This compact viewpoint makes patterns in long strings of digits easier to see.
How shorter repunits divide longer ones
There is a useful relationship between the lengths of two repunits. If one length divides another, the shorter repunit divides the longer one. For instance, 3 divides 6, and indeed:
111,111 = 111 × 1,001
The reason comes from factoring powers. If n = km, then 10n − 1 is 10km − 1, which is divisible by 10m − 1. Dividing both expressions by 9 gives the corresponding relationship between Rn and Rm.
The common factors of two decimal repunits have an especially tidy description: the greatest common divisor of Rm and Rn is Rgcd(m,n). Here, gcd means the greatest common divisor of the two lengths. For example, the greatest common divisor of 6 and 8 is 2, so the greatest common divisor of R6 and R8 is R2, or 11.
This result does not mean that every factor of a repunit must itself be a repunit. A factor can have a completely different digit pattern. The relationship describes the shared factors between repunits, not the full list of factors for each one.
Repunit primes and composite numbers
A prime number has exactly two positive divisors: 1 and itself. Some repunits are prime. The two-digit repunit, 11, is a familiar example. But a long row of 1s is not automatically prime, and checking primality becomes harder as the number grows.
The length gives one useful clue. If n is composite, write it as a product of integers a and b, each greater than 1. Then Ra divides Rn, so Rn has a factor other than 1 and itself. Therefore, a decimal repunit can be prime only if its length is prime. This is a necessary condition, not a guarantee.
For example, R3 has prime length, but 111 = 3 × 37, so it is composite. A prime length narrows the possibilities without settling the question. Testing whether a very large repunit is prime can require substantial computation, and mathematical results about particular lengths should not be inferred just from the length alone.
Repunit factorisation is one small part of number theory, the branch of mathematics that studies integers and their properties. It offers clean examples of how a simple pattern can lead to questions about primes, factors, and divisibility.
Connections to repeating decimals
Repunits also appear naturally when fractions are written as decimals. The familiar equality 1/9 = 0.111… says that an endless string of 1s after the decimal point represents one ninth. A finite repunit is related to this idea: Rn / 10n gives a decimal with n places, such as 111/1,000 = 0.111.
Repeating decimals can produce exact divisibility relationships. For example, 1/7 = 0.142857142857… has a repeating block of six digits. The integer formed by six 1s, 111,111, is divisible by 7: 111,111 = 7 × 15,873. This does not mean every repeating decimal has a block made of 1s; rather, repunits provide one way to explore how decimal patterns relate to integer factors.
More generally, a fraction with a denominator that shares no factors with 10 has a repeating decimal expansion. The length of its repeating block is connected to the remainders that arise when dividing powers of 10 by that denominator. Repunits enter the picture because Rn = (10n − 1)/9, linking powers of 10, divisibility, and strings of repeated digits.
Why mathematicians study them
Repunits are useful as examples because their definition is uncomplicated while their factor patterns are not always obvious. They let students and researchers practise using divisibility tests, prime factorisation, geometric series, and modular arithmetic on a family of numbers that can be described with one formula.
They are also a reminder that written digits and numerical value are different ideas. The string “111” has a particular appearance, but its value depends on its base: it is 111 in decimal and 7 in binary. The formula for a repunit makes that dependence explicit and allows the same kind of pattern to be studied in different numeral systems.
For practical calculations, extremely long repunits need not be written out. A computer can work with the formula or calculate remainders as it goes. This is especially helpful when the question is whether a repunit is divisible by a particular number, since a remainder can often be determined without storing the entire enormous integer.
Conclusion
Numbers made entirely from repeated 1s are called repunits, and their compact formula connects them to powers of 10, geometric series, and divisibility. Their lengths reveal some factors, while prime lengths and repeating decimals raise further questions without making every case predictable. Repunits are a clear example of how an elementary-looking digit pattern can open a door to deeper number theory.

