Repdigit
A repdigit is a natural number in a given base (typically base 10) that consists of one or more identical digits repeated consecutively, with no other digits present.[1] Examples in base 10 include the single-digit numbers from 1 to 9, as well as multi-digit forms such as 11, 22, 333, 4444, and 99999.[1] The concept of repdigits arises in recreational mathematics, where they are studied for patterns, properties, and connections to other numerical forms.[1] A repdigit with the digit d (where $1 \leq d \leq 9) repeated n times in base 10 can be expressed mathematically as d \times \frac{10^n - 1}{9}.[2] In general bases b > d \geq 1, the form generalizes to d \times \frac{b^n - 1}{b - 1}, highlighting their structure as scaled geometric series.[3] The term "repdigit," short for "repeated digit," was coined by mathematician Charles W. Trigg in 1974, building on earlier discussions of such numbers as "monodigits" in Albert H. Beiler's 1964 work.[4][1] A special subclass, repunits (repdigits where d = 1), has drawn particular attention due to their factorization challenges and rare primality; for instance, repunit primes include R_{19} (19 ones) and the largest known proven one, R_{86453} (86,453 ones), as of 2023.[5] Repdigits also appear in problems involving palindromes, polygonal numbers, and Diophantine equations, underscoring their role in number theory explorations.[2]Basic Concepts
Definition
A repdigit is a natural number that consists entirely of repetitions of a single digit in a given base, typically base 10 unless specified otherwise. For example, in base 10, the numbers 5, 77, and 999 are repdigits, where the digit 5 is repeated once, 7 twice, and 9 three times, respectively. Single-digit natural numbers (1 through 9) are trivially repdigits, as they consist of a single occurrence of one digit, while leading zeros are not permitted in standard numerical representation.[6][3][7] In general, for a base b > 1, a repdigit is formed by repeating a digit d (where $0 < d < b) exactly n times, with n \geq 1. This number can be expressed mathematically as d \cdot \frac{b^n - 1}{b - 1}, which is d times the repunit of length n in base b. Repunits themselves are the special case where d = 1, but repdigits encompass any valid d. Thus, every repdigit is a multiple of the corresponding repunit of the same length.[6][3][8] In base 10, a repdigit with n digits of d satisfies the congruence \equiv n d \pmod{9}, following the general property that any integer is congruent to the sum of its digits modulo 9. Unlike repunits, which are fixed to d = 1, repdigits allow variation in d; unlike automorphic numbers, which when squared end in themselves (e.g., 25² = 625), repdigits are defined solely by their digit repetition without any squaring condition.[6][3][8]Notation and Examples
In base 10, a repdigit consisting of n repetitions of the digit d (where $1 \leq d \leq 9) is expressed mathematically as d \times \frac{10^n - 1}{9}.[9] This notation arises from the geometric series sum for the digit repetitions, and repdigits are sometimes compactly denoted as d_n for brevity.[3] In a general base b > d > 0, the analogous form is d \times \frac{b^n - 1}{b-1}.[6] Examples of repdigits illustrate their structure across varying lengths and digits. The single-digit numbers 1 through 9 are the simplest repdigits, each with n=1. For n=2, the repdigits are 11, 22, 33, 44, 55, 66, 77, 88, and 99. Longer repdigits include 1111 (d=1, n=4) and 88888 (d=8, n=5). In non-decimal bases, such as base 2, the repdigit $111_2 (three repetitions of digit 1) equals $7_{10}.[6] Numbers composed solely of zeros, like 00 or 000, are excluded from the class of repdigits, as the concept applies to positive integers with a non-zero repeated digit.[3] The following table lists small base-10 repdigits by digit d (1 to 9) and length n (1 to 3), with their decimal values:Historical Background
Early References
In ancient numeral systems, numbers were frequently represented through the repetition of basic symbols to denote multiples, serving as conceptual precursors to repdigits in modern positional notation. The Egyptian hieroglyphic system, dating back to around 3000 BCE, used repeated vertical strokes (|) for units up to nine, repeated cattle hobbles for tens, and repeated lotus flowers or coils for hundreds and higher powers of ten, allowing efficient additive representation without a true zero or place value. Similarly, the Babylonian cuneiform system from circa 2000 BCE employed repeated horizontal or vertical wedges in a sexagesimal (base-60) framework, where multiples were indicated by duplicating symbols within place values, though lacking a dedicated zero symbol until later refinements. During the medieval period, the adoption of Hindu-Arabic numerals facilitated the emergence of repdigits in base-10 calculations within mathematical texts. In Islamic mathematics, works like Muhammad ibn Musa al-Khwarizmi's On the Calculation with Hindu Numerals (circa 825 CE) introduced positional notation to the Islamic world, incorporating examples of arithmetic operations that naturally produced or utilized numbers with repeated digits in astronomical and commercial computations, building on earlier Indian developments from the 6th–7th centuries CE. In Europe, Leonardo of Pisa (Fibonacci)'s Liber Abaci (1202) popularized these numerals through practical problems in accounting and geometry, featuring repdigits such as 11, 22, and notably 55 (the tenth term in the sequence now named after him) in illustrative calculations and problem-solving exercises. By the 19th century, interest in repdigits, particularly repunits (all 1s), grew within number theory and recreational mathematics as tools for exploring divisibility and primality. German mathematician Gustav Reuschle systematically factored repunits up to R_{16} and identified divisors for some larger ones in 1856, leveraging tables of decimal periods of prime reciprocals published earlier in the century to advance understanding of their composite nature.[10] Such analyses highlighted early repunit primes like R2 = 11 and R19 (proved prime in 1916 but studied earlier), laying groundwork for later investigations into their algebraic factors. Recreational puzzles involving repdigits also appeared in periodicals and books, often challenging readers to find multiples or properties of numbers like 111 or 222, predating formalized collections by figures like Sam Loyd.[10]Modern Developments
In the 20th century, interest in repunit primes—a subset of repdigit primes consisting entirely of the digit 1—intensified with the advent of electronic computers, enabling systematic searches and factorizations of larger instances. The term "repunit" was coined by Albert H. Beiler in 1966 to describe numbers of the form R_n = \frac{10^n - 1}{9}. John Selfridge made significant contributions to the factorization of repunits as part of the Cunningham Project, which tabulated factors of numbers like $10^n \pm 1 and supported early computational efforts in the 1960s and 1970s. By the 1970s and 1980s, computers facilitated discoveries such as the repunit prime R_{317} (317 digits), identified as a probable prime around 1966 and proven prime in 1977 by Hugh C. Williams, with further computational analysis thereafter, and R_{1031} (1031 digits), proven prime in 1986 by H. C. Williams and Harvey Dubner using advanced primality tests.[11] These efforts laid the groundwork for understanding repunit primality, with mathematicians like Dubner pioneering distributed computing approaches to test vast ranges of n. In the late 20th century, factorizations revealed algebraic properties, such as cyclotomic factors dividing R_n when n is composite, aiding in the exclusion of non-prime candidates.[12] The 21st century has seen exponential growth in the scale of repunit prime searches, driven by high-performance computing and probabilistic primality tests like ECPP (Elliptic Curve Primality Proving). Distributed projects such as PrimeGrid have played a pivotal role, coordinating volunteer resources to scan millions of candidates; for instance, their Repunit subproject has identified numerous probable primes beyond traditional limits. Key milestones include the probable prime R_{49081} (49,081 digits), discovered by Dubner in 1999 and rigorously proven prime in 2022 by Paul Underwood after two decades of verification efforts.[13] In May 2023, R_{86453} (86,453 digits), previously identified as a probable prime in 2000 by Lew Baxter, was proven prime. Larger probable repunit primes followed, such as R_{109297} (109,297 digits), identified as a probable prime in 2007 by Harvey Dubner and Paul Bourdelais and proven prime in May 2025, marking the current record for the largest known repunit prime as of November 2025.[14] Modern researchers in additive number theory have extended repunit studies to generalized forms, exploring their roles in equations involving sums of repdigits and connections to base-b analogs, with contributions from figures like Dmitry Batalov in probabilistic searches up to n > 8 million by 2021.[5] These advancements underscore the interplay between computational power and theoretical insights, though the infinitude of repunit primes remains an open conjecture.[11]Mathematical Properties
Repunits
A repunit is a special case of a repdigit consisting entirely of the digit 1 repeated n times in base 10.[15] The term was coined by Albert H. Beiler in his 1966 book Recreations in the Theory of Numbers.[15] In general, a repunit R_n(b) in base b \geq 2 is defined as R_n(b) = \frac{b^n - 1}{b - 1}, which expands to the sum $1 + b + b^2 + \cdots + b^{n-1}.[16] For the standard base-10 case, this simplifies to R_n = \frac{10^n - 1}{9}, yielding numbers such as R_1 = [1](/page/1), R_2 = 11, R_3 = 111, and R_4 = [1111](/page/1111).[15] Algebraically, repunits exhibit structured divisibility properties that reflect the divisors of their length n. Specifically, if m divides n, then R_m divides R_n.[16] This follows from the geometric series form, as R_n = R_m \cdot (1 + 10^m + 10^{2m} + \cdots + 10^{n-m}).[16] More strongly, the repunits form a divisibility sequence where \gcd(R_m, R_n) = R_{\gcd(m,n)}, analogous to the gcd property in the Euclidean algorithm applied to the exponents.[17] Additionally, the sum of the first n repunits is given by \sum_{k=1}^n R_k = \frac{10 R_n - n}{9}.[18] Repunits connect to cyclotomic polynomials through their generating expression: \frac{x^n - 1}{x - 1} = \prod_{\substack{d \mid n \\ d > 1}} \Phi_d(x), where \Phi_d(x) is the d-th cyclotomic polynomial. Evaluating at x = 10 yields R_n = \prod_{\substack{d \mid n \\ d > 1}} \Phi_d(10), highlighting how the prime factors of n influence the algebraic factorization of R_n. Basic divisibility examples illustrate these properties. For instance, since 2 divides 6, R_2 = 11 divides R_6 = 111111, and indeed $111111 = 11 \times 10101.[15] Similarly, R_3 = 111 divides R_6, with R_6 = 111 \times [1001](/page/1001), where 1001 further factors algebraically as $10^3 + 1 = 7 \times 11 \times [13](/page/13), though the full prime factorization of R_6 is [3](/page/3) \times 7 \times 11 \times 13 \times 37.[15] These relations underscore the periodic and multiplicative structure inherent to repunits.[16]Prime Repdigits
A prime repdigit is a repdigit number that is also prime. The single-digit examples include the primes 2, 3, 5, and 7. For multi-digit repdigits, primality is only possible when all digits are 1, resulting in repunit primes; repdigits with any other repeated digit d > 1 factor as d \times R_k (where R_k is the k-digit repunit and k > 1), making them composite since both factors exceed 1.[8] Repunit primes take the form R_n = \frac{10^n - 1}{9}, consisting of n ones, and are prime only if n is prime—a necessary but insufficient condition, as composite n allows algebraic factorization of R_n into smaller repunits.[11] Searches thus target prime exponents n, with rarity escalating as n grows due to the decreasing density of primes among large numbers. As of May 2025, eight repunit primes have been rigorously proven, listed below with their digit lengths (equal to n) and discovery details:| n | Digits | Status | Discovery Notes |
|---|---|---|---|
| 2 | 2 | Proven | Historical (e.g., R_2 = 11) |
| 19 | 19 | Proven | Historical (R_{19}) |
| 23 | 23 | Proven | Historical (R_{23}) |
| 317 | 317 | Proven | Historical |
| 1031 | 1031 | Proven | Dec 1985, Williams & Dubner |
| 49081 | 49081 | Proven | Probable 1999 (Dubner); proven Mar 2022 (ECPP) |
| 86453 | 86453 | Proven | Probable Oct 2000 (Baxter); proven May 2023 (ECPP) |
| 109297 | 109297 | Proven | Probable 2007 (Bourdelais & Dubner); proven May 2025 (ECPP) |
Composite Repdigits
A repdigit consisting of n digits all equal to d (where $1 \leq d \leq 9 and n > 1) is mathematically expressed as d_n = d \times R_n, where R_n = \frac{10^n - 1}{9} is the repunit of n ones.[20] This algebraic structure implies that factorization patterns of repdigits largely inherit those of the corresponding repunit, scaled by the digit d. For instance, the three-digit repdigit 111 factors as $3 \times 37, while 222 = $2 \times 3 \times 37.[15] When d > 1, d_n is composite for all n > 1, as it is the product of two integers greater than 1 (d > 1 and R_n > 1).[21] Even for d = 1 (pure repunits), compositeness arises predictably from the structure of R_n. A fundamental result states that if n is composite, then R_n factors algebraically into nontrivial components, rendering it composite; for example, if n = ab with a, b > 1, then R_n = R_b \times (1 + 10^b + 10^{2b} + \cdots + 10^{(a-1)b}), where both factors exceed 1.[21] Since there are infinitely many composite values of n, this yields infinitely many composite repunits.[22] Beyond repunits, composite repdigits exhibit additional factorization patterns tied to d and n. For even d, d_n is divisible by 2, ensuring compositeness for n > 1. Repdigits with even n are also divisible by 11, as their digits form a palindrome, making the alternating sum of digits zero (a multiple of 11). For example, the four-digit repdigit 4444 factors as $4 \times 11 \times 101.[23] These properties highlight how structural features of repdigits facilitate algebraic factorizations, with most such numbers being composite due to the prevalence of composite n and d > 1.Advanced Generalizations
k-Brazilian Numbers
A k-Brazilian number is a natural number in base 10 whose decimal representation employs exactly k distinct digits from 0 to 9, with each of these digits occurring precisely the same number of times, denoted m ≥ 1, yielding a total length of km digits (excluding leading zeros). Repdigits, which use a single digit repeated m times, correspond to the case k=1. This generalization extends the structure of repdigits to scenarios where multiple digits are balanced in frequency, often arising in patterns like repeating blocks for mathematical analysis.[24] For k=2, consider examples such as 121212, where digits 1 and 2 each appear three times (m=3). Such numbers can be expressed using a repeating block of length k: if the block is the k-digit integer s (with distinct nonzero digits for the leading position), repeated m times, the value is s × (10^{km} - 1) / (10^k - 1). This formula generalizes the repunit expression (10^{km} - 1)/9 for k=1, representing a geometric series sum. In base representations, these numbers exhibit periodic structures, akin to fractions with repeating decimals of period k.[24] k-Brazilian numbers hold mathematical interest due to their factorization properties and relative scarcity of primes for k > 1. The repeating block form often factors algebraically; for instance, if m is composite, (10^{km} - 1)/(10^k - 1) divides into smaller cyclotomic polynomials, rendering the number composite unless s compensates precisely. Divisibility rules mirror those for repunits: the number is divisible by primes p if the order of 10 modulo p divides km but not k, with exceptions for factors of s. Primes among k-Brazilian numbers are rare for k > 1, as the balanced digit structure typically introduces algebraic factors, though examples exist for larger k derived from full-period reptend primes, such as repetitions of the 6-digit cyclic block 142857 yielding primes like 1428571428571 (13 digits). Up to 6 digits, there are no known primes for k=2 in the strict repeating block case, highlighting their elusiveness.[25] These structures connect to cyclic numbers, which are (p-1)-digit integers arising from the repeating period of 1/p for prime p with full reptend length p-1, featuring k = p-1 distinct digits. Repeating such a cyclic block m times produces a k-Brazilian number with each digit repeated m times, preserving permutation properties under multiplication by integers up to k. For example, multiples of 142857 yield digit rotations, and full repetitions maintain divisibility by the underlying repunit factor (10^{k} - 1)/9. Enumeration of k-Brazilian numbers up to length l focuses on combinatorial counts: for fixed k and m = l/k, select k distinct digits (9 choices for the first, 9 remaining including 0 but adjusting for leading), then arrange via the multinomial coefficient (km)! / (m!)^k, yielding approximately 10^k × (km)! / (m!)^k / 10^{km-1} valid numbers (accounting for leading zeros). For small values, k=2 up to 4 digits (m=2) includes 90 such numbers, scaling rapidly but with most composite.[25]Repunit Powers and Composites
Repunit powers, denoted (R_n)^m where m > 1, exhibit interesting structural properties, particularly for small values of m. For m = 2, the squares of repunits form a sequence known as Demlo numbers, which are palindromic for n \leq 9. Examples include R_2^2 = 11^2 = 121 and R_3^2 = 111^2 = 12321, both reading the same forwards and backwards. These numbers arise from the expansion of ((10^n - 1)/9)^2 and demonstrate symmetric digit patterns up to a point, after which anomalies appear, such as the missing digit 8 in R_{10}^2 = 1234567901234567901. Higher powers (R_n)^m for m > 2 produce similarly symmetric but more complex forms, often factorable algebraically due to their polynomial nature in base 10.[26] A key theorem states that repunit powers (R_n)^m for m > 1 and n > 1 are always composite, as they are integers greater than 1 raised to a power exceeding 1, hence non-prime by definition. This holds trivially from basic properties of prime numbers, excluding the case R_1^m = 1^m = 1, which is neither prime nor composite. In the subclass of repunit powers, the density of composites is 1, as no primes exist beyond trivialities.[15] Turning to composite repunits themselves, which form the majority of the sequence, their factorizations rely on the fundamental divisibility property: if d divides n, then R_d divides R_n. This implies that R_n is composite whenever n is composite, since it admits a proper divisor R_d with $1 < d < n. The quotient R_n / R_d = \sum_{j=0}^{(n/d)-1} 10^{j d} is an integer resembling a repunit in base $10^d. For example, R_6 = 111111 = R_2 \times 10101 = 11 \times 10101, where further factorization yields $10101 = 3 \times 7 \times 13 \times 37, or alternatively R_6 = R_3 \times [1001](/page/1001) = 111 \times [1001](/page/1001) with $1001 = 7 \times 11 \times 13 and $111 = 3 \times 37, resulting in the complete prime factorization $3 \times 7 \times 11 \times 13 \times 37. Such algebraic decompositions highlight non-trivial factors beyond simple repunit divisors, contributing to advanced factorization techniques for larger R_n.[24][27] These properties underscore the composite nature of most repunits, with finitely many known primes, including R_2, R_3, R_5, R_7, R_13, R_17, R_19, R_23, R_31, R_317, R_1031, and R_49081 (the largest proven as of 2022). Larger probable repunit primes, such as R_8177207 (8,177,207 digits, discovered in 2021), are known but unproven. This implies a composite density approaching 1 in the sequence, though infinitude of primes remains conjectural. Advanced factorizations often reveal primitive prime divisors unique to specific R_n, enhancing their study in number theory.[15][28]Cultural and Applied Contexts
Numerology
In numerology, a pseudomathematical practice with roots in ancient philosophies, repdigits—numbers consisting of identical repeated digits—are interpreted as amplified expressions of the single digit's inherent qualities. This concept traces back to Pythagorean numerology, where numbers were assigned mystical properties symbolizing cosmic principles, and repetitions such as the master numbers 11, 22, and 33 were viewed as intensifying the base digit's vibration, representing heightened spiritual potential or karmic forces.[29][30] For instance, the repeated 9 is often linked to themes of completion, humanitarianism, and universal love, echoing Pythagoras's association of 9 with the ennead as a symbol of wholeness.[30] In contemporary New Age interpretations, repdigits have gained prominence as "angel numbers," believed to convey messages from spiritual guides or the universe to provide guidance and affirmation. These sequences are seen as signs of synchronicity, urging individuals to align their thoughts and actions with higher purposes. For example, 111 is commonly regarded as a prompt for manifestation and spiritual awakening, signaling that one's intentions are aligning with reality, while 222 symbolizes balance, harmony in relationships, and encouragement to maintain faith during uncertainty.[31][32] Such meanings emphasize personal growth and intuitive awareness rather than empirical calculation. The modern surge in repdigit numerology's popularity began in the early 2000s through self-help literature and online spiritual communities, largely attributed to Doreen Virtue's seminal book Angel Numbers, which cataloged interpretations of repeating sequences as direct communications from angels.[33] This framework has since proliferated in New Age practices, with practitioners using repdigits in meditation, journaling, and digital divination apps to interpret daily synchronicities, fostering a cultural narrative of empowerment through numerical symbolism.[31]Computing and Recreational Mathematics
In computing, repdigits, particularly repunits (numbers consisting of repeated 1s), are commonly generated using simple string manipulation or arithmetic formulas in programming languages. For instance, in Python, a repunit R_n with n digits can be constructed as R_n = \frac{10^n - 1}{9}, which avoids overflow for small n but requires arbitrary-precision arithmetic for larger values. A basic loop implementation might look like this:This method leverages Python's built-in big integer support, but for efficiency in generating and testing very large repunits (e.g., millions of digits), libraries like SymPy or GMP are employed to handle primality checks.[34][35] Repdigits play a role in computational number theory, especially for prime testing with big integer libraries. The GNU Multiple Precision Arithmetic Library (GMP) is widely used for factoring and primality testing of repunit primes, such as the known primes R_{19}, R_{23}, and R_{317}, which have up to thousands of digits. GMP's probabilistic primality functions, like Miller-Rabin, enable efficient verification of these large candidates, as demonstrated in projects optimizing repunit searches.[36][37] In recreational mathematics, repdigits feature in puzzles involving divisibility and patterns. A classic challenge is identifying repdigit multiples of 13; for example, any repdigit formed by repeating a single digit d (where $1 \leq d \leq 9) exactly $6k times is divisible by 13, as $111111 \equiv 0 \pmod{[13](/page/13)} and longer multiples follow by concatenation properties. The smallest such repunit is $111111 = [13](/page/13) \times 8547, often used in problems to find the minimal length or quotient.[38] Variants of Kaprekar's routine, which rearranges a number's digits to form the largest and smallest possible values and subtracts them iteratively, treat repdigits as trivial fixed points. Applying the routine to a repdigit like 2222 yields 2222 - 2222 = 0, leading to a cycle of zeros rather than the standard constant (e.g., 6174 for four-digit numbers). This property highlights repdigits' stability in digit-sorting algorithms and inspires extensions, such as testing in different bases or digit lengths.[39][40] Recreational games and arithmetic tricks often center on repdigit properties for quick mental calculations. One popular puzzle involves multiplying a repdigit (e.g., 111 or 1111) by a single digit, exploiting patterns like $111 \times 9 = 999 or $1111 \times 7 = 7777, which reveal underlying divisibility rules without full computation. These activities appear in math puzzle collections, encouraging pattern recognition.[41] In the 2020s, mobile applications for prime hunting have democratized repdigit exploration, allowing users to generate and test repunits on smartphones using built-in big integer capabilities. Apps like "Prime Numbers" enable listing and checking primes up to large limits, adaptable for repunit sequences via custom inputs, supporting educational hunts for candidates like R_{1031}.[42]pythondef repunit(n): return (10**n - 1) // 9 # Example: Generate R_6 = 111111 print(repunit(6))def repunit(n): return (10**n - 1) // 9 # Example: Generate R_6 = 111111 print(repunit(6))