Repunit

DOWNLOAD Mathematica Notebook

A repunit is a number consisting of copies of the single digit 1. The term "repunit" was coined by Beiler (1966), who also gave the first tabulation of known factors.

In base-10, repunits have the form

R_n=(10^n-1)/(10-1)
(1)
=(10^n-1)/9.
(2)

Repunits R_n therefore have exactly n decimal digits. Amazingly, the squares of the repunits R_n^2 give the Demlo numbers, 1^2=1, 11^2=121, 111^2=12321, ... (OEIS A002275 and A002477).

The number of factors for the base-10 repunits for n=1, 2, ... are 1, 1, 2, 2, 2, 5, 2, 4, 4, 4, 2, 7, 3, ... (OEIS A046053). The base-10 repunit probable primes R_n occur for n=2, 19, 23, 317, and 1031, 49081, 86453, 109297, and 270343 (OEIS A004023; Madachy 1979, Williams and Dubner 1986, Ball and Coxeter 1987, Granlund, Dubner 1999, Baxter 2000), where R_(1031) is the largest proven prime (Williams and Dubner 1986). T. Granlund completed a search up to 45000 in 1998 using two months of CPU time on a parallel computer. The search was extended by Dubner (1999), culminating in the discovery of the probable prime R_(49081). A number of larger repunit probable primes have since been found, as summarized in the following table.

ndiscoverer(s)date
49081H. Dubner (1999, 2002)Sep. 9, 1999
86453L. Baxter (2000)Oct. 26, 2000
109297P.  Bourdelais (2007), H. Dubner (2007)Mar. 26-28, 2007
270343M. Voznyy and A. Budnyy (2007)Jul. 11, 2007

Every prime repunit is a circular prime.

Repunit can be generalized to base b, giving a base-b repunit as number of the form

 M_n^((b))=(b^n-1)/(b-1).
(3)

This gives the special cases summarized in the following table.

bM_n^((b))name
22^n-1Mersenne number M_n
10(10^n-1)/9repunit R_n

The idea of repunits can also be extended to negative bases. Except for requiring n to be odd, the math is very similar (Dubner and Granlund 2000).

bOEISb-repunits
-3A0664431, 7, 61, 547, 4921, 44287, 398581, ...
-2A0075831, 3, 11, 43, 171, 683, 2731, ...
2A0002251, 3, 7, 15, 31, 63, 127, ...
3A0034621, 4, 13, 40, 121, 364, ...
4A0024501, 5, 21, 85, 341, 1365, ...
5A0034631, 6, 31, 156, 781, 3906, ...
6A0034641, 7, 43, 259, 1555, 9331, ...
7A0230001, 8, 57, 400, 2801, 19608, ...
8A0230011, 9, 73, 585, 4681, 37449, ...
9A0024521, 10, 91, 820, 7381, 66430, ...
10A0022751, 11, 111, 1111, 11111, ...
11A0161231, 12, 133, 1464, 16105, 177156, ...
12A0161251, 13, 157, 1885, 22621, 271453, ...

Williams and Seah (1979) factored generalized repunits for 3<=b<=12 and 2<=n<=1000. A (base-10) repunit can be prime only if n is prime, since otherwise 10^(ab)-1 is a binomial number which can be factored algebraically. In fact, if n=2a is even, then 10^(2a)-1=(10^a-1)(10^a+1). As with positive bases, all the exponents of prime repunits with negative bases are also prime.

bOEISn of prime b-repunits
-12A0571785, 11, 109, 193, 1483, ...
-11A0571775, 7, 179, 229, 439, 557, 6113, ...
-10A0015625, 7, 19, 31, 53, 67, 293, ...
-9A0571753, 59, 223, 547, 773, 1009, 1823, ...
-7A0571733, 17, 23, 29, 47, 61, 1619, ...
-6A0571723, 11, 31, 43, 47, 59, 107, ...
-5A0571715, 67, 101, 103, 229, 347, 4013, ...
-3A0076583, 5, 7, 13, 23, 43, 281, ...
-2A0009783, 5, 7, 11, 13, 17, 19, ...
2A0000432, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, ...
3A0284913, 7, 13, 71, 103, 541, 1091, 1367, ...
5A0040613, 7, 11, 13, 47, 127, 149, 181, 619, ...
6A0040622, 3, 7, 29, 71, 127, 271, 509, 1049, ...
7A0040635, 13, 131, 149, 1699, ...
10A0040232, 19, 23, 317, 1031, ...
11A00580817, 19, 73, 139, 907, 1907, 2029, 4801, ...
12A0040642, 3, 5, 19, 97, 109, 317, 353, 701, ...

Yates (1982) published all the repunit factors for n<=1000, a portion of which are reproduced in the Wolfram Language notebook by Weisstein. Brillhart et al. (1988) gave a table of repunit factors which cannot be obtained algebraically, and a continuously updated version of this table is now maintained online. These tables include factors for 10^n-1 (with n odd) and 10^n+1 (with n even and odd). After algebraically factoring R_n, these types of factors are sufficient for complete factorizations.

The sequence of least k such that (n^k-1)/(n-1) is prime for n=1, 2, ... are 2, 3, 2, 3, 2, 5, 3, 0, 2, 17, 2, 5, ... (OEIS A084740), and the sequence of least k such that (n^k+1)/(n+1) is prime for n=1, 2, ... are 3, 3, 3, 5, 3, 3, 0, 3, 5, 5, 5, 3, ... (OEIS A084742).

A Smith number can be constructed from every factored repunit.

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.