The definition of repunits was motivated by recreational mathematicians looking for
prime factors of such numbers. It is easy to show that if
n is divisible by
a, then
Rn(
b) is divisible by
Ra(
b): :R_n^{(b)}=\frac{1}{b-1}\prod_{d|n}\Phi_d(b), where \Phi_d(x) is the d^\mathrm{th}
cyclotomic polynomial and
d ranges over the divisors of
n. For
p prime, :\Phi_p(x)=\sum_{i=0}^{p-1}x^i, which has the expected form of a repunit when
x is substituted with
b. For example, 9 is divisible by 3, and thus
R9 is divisible by
R3—in fact, 111111111 = 111 · 1001001. The corresponding cyclotomic polynomials \Phi_3(x) and \Phi_9(x) are x^2+x+1 and x^6+x^3+1, respectively. Thus, for
Rn to be prime,
n must necessarily be prime, but it is not sufficient for
n to be prime. For example,
R3 = 111 = 3 · 37 is not prime. Except for this case of
R3,
p can only divide
Rn for prime
n if
p = 2
kn + 1 for some
k.
Decimal repunit primes Rn is prime for
n = 2, 19, 23, 317, 1031, 49081, 86453, 109297 ... (sequence
A004023 in
OEIS). On July 15, 2007, Maksym Voznyy announced
R270343 to be probably prime. Serge Batalov and Ryan Propper found
R5794777 and
R8177207 to be probable primes on April 20 and May 8, 2021, respectively. As of their discovery, each was the largest known probable prime. On March 22, 2022, probable prime
R49081 was eventually proven to be a prime. On May 15, 2023, probable prime
R86453 was eventually proven to be a prime. On May 26, 2025, probable prime
R109297 was eventually proven to be a prime. It has been conjectured that there are infinitely many repunit primes and they seem to occur roughly as often as the
prime number theorem would predict: the exponent of the
Nth repunit prime is generally around a fixed multiple of the exponent of the (
N−1)th. The prime repunits are a trivial subset of the
permutable primes, i.e., primes that remain prime after any
permutation of their digits. Particular properties are • The remainder of
Rn modulo 3 is equal to the remainder of
n modulo 3. Using 10
a ≡ 1 (mod 3) for any
a ≥ 0,
n ≡ 0 (mod 3) ⇔
Rn ≡ 0 (mod 3) ⇔
Rn ≡ 0 (mod
R3),
n ≡ 1 (mod 3) ⇔
Rn ≡ 1 (mod 3) ⇔
Rn ≡
R1 ≡ 1 (mod
R3),
n ≡ 2 (mod 3) ⇔
Rn ≡ 2 (mod 3) ⇔
Rn ≡
R2 ≡ 11 (mod
R3).Therefore, 3 |
n ⇔ 3 |
Rn ⇔
R3 |
Rn. • The remainder of
Rn modulo 9 is equal to the remainder of
n modulo 9. Using 10
a ≡ 1 (mod 9) for any
a ≥ 0,
n ≡
r (mod 9) ⇔
Rn ≡
r (mod 9) ⇔
Rn ≡
Rr (mod
R9),for 0 ≤
r < 9.Therefore, 9 |
n ⇔ 9 |
Rn ⇔
R9 |
Rn.
Algebra factorization of generalized repunit numbers If
b is a
perfect power (can be written as
mn, with
m,
n integers,
n > 1) differs from 1, then there is at most one repunit in base-
b. If
n is a
prime power (can be written as
pr, with
p prime,
r integer,
p,
r >0), then all repunit in base-
b are not prime aside from
Rp and
R2.
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., and
R2 can be prime (when
p differs from 2) only if
b is negative, a power of −2, for example,
b = −8, −32, −128, −8192, etc., in fact, the
R2 can also be composite, for example,
b = −512, −2048, −32768, etc. If
n is not a prime power, then no base-
b repunit prime exists, for example,
b = 64, 729 (with
n = 6),
b = 1024 (with
n = 10), and
b = −1 or 0 (with
n any natural number). Another special situation is
b = −4
k4, with
k positive integer, which has the
aurifeuillean factorization, for example,
b = −4 (with
k = 1, then
R2 and
R3 are primes), and
b = −64, −324, −1024, −2500, −5184, ... (with
k = 2, 3, 4, 5, 6, ...), then no base-
b repunit prime exists. It is also conjectured that when
b is neither a perfect power nor −4
k4 with
k positive integer, then there are infinity many base-
b repunit primes.
The generalized repunit conjecture A conjecture related to the generalized repunit primes: (the conjecture predicts where is the next
generalized Mersenne prime, if the conjecture is true, then there are infinitely many repunit primes for all bases b) For any integer b, which satisfies the conditions: • |b|>1. • b is not a
perfect power. (since when b is a perfect rth power, it can be shown that there is at most one n value such that \frac{b^n-1}{b-1} is prime, and this n value is r itself or a
root of r) • b is not in the form -4k^4. (if so, then the number has
aurifeuillean factorization) has generalized repunit primes of the form :R_p(b)=\frac{b^p-1}{b-1} for prime p, the prime numbers will be distributed near the best fit line : Y=G \cdot \log_\left( \log_\left( R_{(b)}(n) \right) \right)+C, where limit n\rightarrow\infty, G=\frac{1}{e^\gamma}=0.561459483566... and there are about : \left( \log_e(N)+m \cdot \log_e(2) \cdot \log_e \big( \log_e(N) \big) +\frac{1}{\sqrt N}-\delta \right) \cdot \frac{e^\gamma}{\log_e(|b|)} base-
b repunit primes less than
N. • e is the
base of natural logarithm. • \gamma is
Euler–Mascheroni constant. • \log_ is the
logarithm in
base |b| • R_{(b)}(n) is the nth generalized repunit prime in base
b (with prime
p) • C is a data fit constant which varies with b. • \delta=1 if b>0, \delta=1.6 if b. • m is the largest natural number such that -b is a 2^{m-1}th power. We also have the following 3 properties: • The number of prime numbers of the form \frac{b^n-1}{b-1} (with prime p) less than or equal to n is about e^\gamma \cdot \log_\big(\log_(n)\big). • The expected number of prime numbers of the form \frac{b^n-1}{b-1} with prime p between n and |b| \cdot n is about e^\gamma. • The probability that number of the form \frac{b^n-1}{b-1} is prime (for prime p) is about \frac{e^\gamma}{p \cdot \log_e(|b|)}. ==History==