Racira Calculator

Repunit Length Calculator

Repunit Length Calculator

The Repunit

10 gives 1, 11, 111 …

digits
Divisibility Test

7, 11, 37, 101 …

R_19(10)
1,111,111,111,111,111,111
19 digits in base 10 — a repunit of length 19 has 19 ones in base 10
Length Primeyes
Digit Sum19
Divisor Order6
Repunit PropertyResult
Repunit formulaR_19(10) = (10^19 − 1) / (10 − 1)
Exact value1,111,111,111,111,111,111
Magnitude1.111 × 10^18
Digits in base 1019
Digits in the working base19 — one leading 1 followed by 18 more
Digit sum in base 1019
Is the length 19 prime?yes
Prime factors of the length19
Repunit factorisation ruleR_19 is divisible by every R_d where d divides 19: lengths 19
Does 7 divide R_19(10)?no
Smallest length whose repunit is divisible by 76
Test modulus used63 = 7 × 9
Prime repunit candidateconfirmed prime in this base (exponent 19 is on the known list)
Known prime exponents in this base2, 19, 23, 317, 1,031, 49,081, 86,453, 109,297, 270,343
R_19(10)19 digits · prime length
Summary Statistics
Base10
Length19
Decimal digits19
Magnitude1.111 × 10^18
Smallest divisible length6
Divisor divides this repunitno
Factors of the length19
Prime repunit in this baseknown prime

R_19(10) is one of the known prime repunits in this base.

What Is a Repunit Length Calculator?

A repunit length calculator takes a base and a length and reports the repunit those two numbers define — the integer written as a run of ones in that base, whose value is (bⁿ − 1) / (b − 1). It then answers the questions that come up whenever repunits appear in a problem: how many digits the value has in base 10, whether the length is prime, which smaller repunits divide it, and what the smallest length is whose repunit a chosen divisor can divide.

Repunits sit at the meeting point of two classical ideas. In base 10 they are the all-ones numbers that turn up in repeating-decimal arithmetic — 1/7 has a period of six digits and 7 divides 111,111 — while in base 2 they are the Mersenne numbers 2ⁿ − 1, which is where the search for the largest known primes has historically lived.

How It Works

The value is computed from the geometric-series identity. A repunit of length n in base b equals 1 + b + b² + … + bⁿ⁻¹, which sums to (bⁿ − 1) / (b − 1). The calculator builds the exact integer while that is cheap, up to 200 digits, and switches to a magnitude estimate after that, because a repunit of length 270,343 has 270,343 digits and no display is better off printing them.

Divisibility comes from the same identity. A number m divides R_n(b) exactly when m(b − 1) divides bⁿ − 1, which is true when bⁿ leaves a remainder of 1 modulo m(b − 1). Modular exponentiation checks whether your chosen length satisfies that, and a walk that multiplies the residue by the base one step at a time finds the smallest length n that works — the multiplicative order of b modulo the modulus. Every length that works is a multiple of that smallest one, so a single number in the results explains the whole pattern.

The factorisation rule follows too. R_n(b) is divisible by R_d(b) whenever d divides n, so a composite length always produces a composite repunit and prime-length repunits are the only interesting cases. The calculator lists the prime factors of the length, names the divisor lengths they imply, and flags whether the length appears on the published list of exponents that give a prime repunit in the base being tested.

Understanding Your Results

The primary card is the repunit itself: exact digits when the length is short enough, scientific notation otherwise. The three-stat bar shows whether the length is prime, the sum of the decimal digits when the value was computed exactly, and the smallest length whose repunit your test divisor can divide.

The breakdown table carries the formula, the exact or truncated value, the digit counts in both bases, the digit sum, the primality and factorisation of the length, the divisibility verdict for your divisor, the modulus that was tested and the known prime exponents for that base. The summary panel collects the headline numbers, including the verdict line that says whether the length can possibly give a prime repunit at all.

Treat the primality flags carefully. A prime length is necessary for a prime repunit but nowhere near sufficient — R_3 in base 10 is 111 = 3 × 37 and R_5 is 11,111 = 41 × 271 — and proving a long repunit prime needs either algebraic factorisation work or a probabilistic primality test on a number with hundreds of thousands of digits. The known lists quoted here are the published exponents, not a claim that shorter lengths have been ignored.

Frequently Asked Questions

Related Calculators