Mathwords logoMathwords

Repunit — Definition, Formula & Example

A repunit is a positive whole number written using only the digit 1, such as 1, 11, 111, or 1111. The name is short for "repeated unit."

For a natural number n≥1n \ge 1, the nnth repunit RnR_n is the number whose base-10 representation consists of exactly nn ones. Equivalently, Rn=∑k=0n−110k=10n−19R_n = \sum_{k=0}^{n-1} 10^k = \dfrac{10^n - 1}{9}.

Key Formula

Rn=10n−19R_n = \frac{10^n - 1}{9}
Where:
  • RnR_n = The repunit with n digits, all equal to 1
  • nn = The number of ones (digits) in the repunit, a natural number

Worked Example

Problem: Use the formula to find the repunit R6R_6. Then show that it is composite by using the fact that 6 = 2 × 3.
Step 1: Substitute n = 6 into the formula. The number 106−110^6 - 1 is six nines, and dividing by 9 leaves six ones.
R6=106−19=999,9999=111,111R_6 = \frac{10^6 - 1}{9} = \frac{999{,}999}{9} = 111{,}111
Step 2: Because 6 is divisible by both 2 and 3, R6R_6 is divisible by the repunits R2=11R_2 = 11 and R3=111R_3 = 111. Check both divisions.
111,111÷11=10,101111,111÷111=1,001111{,}111 \div 11 = 10{,}101 \qquad 111{,}111 \div 111 = 1{,}001
Step 3: Combine these results into the full prime factorization. You can multiply the factors to confirm the product.
111,111=3×7×11×13×37111{,}111 = 3 \times 7 \times 11 \times 13 \times 37
Answer: R6=111,111R_6 = 111{,}111. It is composite because it equals 3×7×11×13×373 \times 7 \times 11 \times 13 \times 37. In general, whenever aa divides nn, the repunit RaR_a divides RnR_n.

Why It Matters

Repunits are a good testing ground for divisibility rules. The digit sum of RnR_n is nn, so RnR_n is divisible by 3 exactly when nn is a multiple of 3. Repunit primes are rare and are the target of computer searches in number theory. Only a handful are known, starting with R2R_2, R19R_{19}, and R23R_{23}.

Common Mistakes

Mistake: Assuming a repunit is prime whenever its number of digits is prime.
Correction: A prime number of digits is necessary for a repunit prime, but it is not enough. For example, R3=111=3×37R_3 = 111 = 3 \times 37 and R5=11,111=41×271R_5 = 11{,}111 = 41 \times 271 are both composite.

Related Terms

  • Natural Numbers — The set every repunit belongs to
  • Digit — Repunits use only the single digit 1
  • Composite Number — Most repunits, such as 111 and 1111, are composite
  • Even Number — Repunits end in 1, so none are even
  • Integers — Larger number set containing all repunits as positive members
  • Prime Number — Some repunits are prime, a classic number theory question