Repunit Calculator

R(n) = 111...1

CalculatorsFreeNo Signup
4.8(709 reviews)
All Tools

Loading tool...

About Repunit Calculator

A repunit calculator exploring R(n) = 111...1 (n ones). Tests primality, shows prime factorization of small repunits, generates the sequence, and lists known repunit primes. Generalizes to repunits in any base. Client-side.

Repunit Calculator Features

  • R(n) value
  • Primality
  • Factorization
  • Sequence
  • Any base
Repunit: R(n) = (10ⁿ−1)/9 = 111...1 (n ones). R(1)=1, R(2)=11, R(3)=111, R(7)=1111111. Repunit primes: R(2)=11, R(19), R(23), R(317), R(1031)... n must be prime for R(n) to be prime. Generalized: R_b(n) = (bⁿ−1)/(b−1).

How to Use

Enter n:

  • R(n): The repunit value
  • Prime?: Primality test
  • Factors: For small n

Repunit Primes

R(n) prime only if n is prime (necessary, not sufficient). Known prime R(n): n = 2, 19, 23, 317, 1031, 49081, 86453, ... Only 8 known! Finding new ones is an active research area.

Generalized Repunits

In base b: R_b(n) = (bⁿ−1)/(b−1). Base 2: Mersenne numbers M(n)=2ⁿ−1. Base 3: (3ⁿ−1)/2. Repunit concept unifies many primality searches.

Step-by-Step Instructions

  1. 1Enter n.
  2. 2View R(n).
  3. 3Check primality.
  4. 4See factors.
  5. 5Try other bases.

Repunit Calculator — Frequently Asked Questions

Why must n be prime for R(n) to be prime?+

If n=ab, then R(n) = R(a) × (10^(a(b-1)) + 10^(a(b-2)) + ... + 1). So R(n) has R(a) as a factor. Example: R(6) = 111111 = 111 × 1001 = R(3) × 1001. Only prime n gives a chance at R(n) being prime.

How many repunit primes are known?+

Only 8 confirmed: R(2)=11, R(19), R(23), R(317), R(1031), R(49081), R(86453), R(109297). Several probable primes await full proof. Testing is extremely difficult as R(n) has n digits.

What is the connection to Mersenne primes?+

Mersenne numbers M(n) = 2ⁿ−1 are repunits in base 2: R_2(n) = 111...1₍₂₎. The primality theories are analogous. Mersenne primes have more efficient tests (Lucas-Lehmer), which is why more are known.

Share this tool: