Fact-checked by Grok 2 weeks ago

Cyclic number

A cyclic number is an integer with a specific number of digits such that the products of this number by the integers 1 through the number of digits yield cyclic permutations of its own digits. The most prominent example is 142857, a six-digit cyclic number derived from the repeating decimal expansion of 1/7 = 0.142857142857..., where multiples from 1×142857 to 6×142857 produce rearrangements like 142857, 285714, 428571, 571428, 714285, and 857142, respectively. These numbers arise from the period of the decimal expansion of reciprocals of s, which are primes p where the decimal period of 1/p is exactly p-1 digits long; examples include 7, 17, 19, 23, 29, 47, 59, 61, and 97. For such a prime p with period n = p-1, the cyclic number is the n-digit repeating block from the decimal expansion of 1/p, treated as a digit string. Notably, 142857 × 7 = 999999, illustrating Midy's theorem, which states that for a cyclic number generated by a , multiplication by p yields a string of n 9's. Cyclic numbers hold significance in due to their connection to the distribution of full reptend primes among all primes, approximated by Artin's constant (approximately 0.3739558136), suggesting that about 37.4% of primes are full reptend primes, though this remains unproven for infinitude. Their study intersects with topics like primitive prime factors and cyclotomic polynomials.

Fundamentals

Definition

A cyclic number is an represented by a string of exactly d (possibly including leading zeros in the string representation) such that, when multiplied by any k where $1 \leq k \leq d, the product k \cdot c, when represented as a d- string (padding with leading zeros if necessary to maintain d and without additional digits beyond d), has digits that form a of the string of c. This ensures no carry-over occurs during the in the cyclic sense and that the strings match exactly without leading zeros in the numerical value where applicable, but allowing padding for consistency. Mathematically, if c is a cyclic number with d digits, then for each k = 1, 2, \dots, d, k \cdot c \equiv \rotate(c, s(k)) \pmod{10^d - 1}, where \rotate(c, s(k)) denotes the digit string obtained by rotating the digits of c left by s(k) positions, with s(k) depending on k, and the result is taken modulo $10^d - 1 to fit the d-digit repetend. This property holds in a given base (typically base 10), and the multiples remain permutations—specifically rotations—of the original digits in the fixed-length string. Such numbers often arise from the repeating portions of expansions of reciprocals $1/n, where d divides the period length of the expansion, particularly for full reptend primes n = d + 1.

Examples

Trivial examples include the single-digit numbers through 9, where the only multiple (k=1) is the number itself, forming a trivial . A prominent example of a cyclic number is the six-digit integer 142857.
This sequence appears in the repeating expansion of \frac{1}{7}.
When 142857 is multiplied by each integer from to 6, the result is a of its digits, demonstrating the defining rotational property.
The multiples are as follows:
MultiplierProduct
142857
2285714
3428571
4571428
5714285
6857142
Another cyclic number arises from the prime , forming the 16-digit sequence 0588235294117647.
Multiplying this number by integers from to 16 yields rotations of its digit sequence.
For the number 142857, multiplication by 7 produces 999999, a repetition of six nines that aligns with the period length but does not permute the original digits.

Relation to Repeating Decimals

Connection to fractional expansions

Cyclic numbers arise prominently in the decimal expansions of unit fractions $1/p, where p is a prime number not equal to 2 or 5, and the expansion has a maximal repeating period of exactly p-1 digits. In such cases, the repeating block of digits, known as the repetend, forms a cyclic number, meaning that the multiples of this block up to p-1 times produce cyclic permutations of its digits. This connection stems from the purely periodic nature of these expansions, where the decimal immediately enters its repeating cycle without any non-repeating digits. The mechanism behind this phenomenon is revealed through the process for computing $1/p. Starting with the initial of 1, each subsequent step multiplies the current by 10 and divides by p to obtain the next , with the new being $10 \times (previous ) p. When the multiplicative order of 10 p—the smallest positive k such that $10^k \equiv 1 \pmod{p}—equals p-1, the remainders through all from 1 to p-1 exactly once before repeating. The sequence of generated from these remainders, when concatenated, yields the , and the property in multiples follows because multiplying by from 1 to p-1 simply shifts the starting point in this full of remainders. This link has been observed historically in specific examples, such as the decimal expansion of $1/7 = 0.\overline{142857}, where the 6-digit repetend 142857 is the smallest cyclic number, and its multiples (e.g., $2 \times 142857 = 285714) are rotations of the same digits. For the repetend to produce a cyclic number, the period must be the full length p-1, rather than a proper divisor of p-1, which occurs precisely when 10 is a primitive root modulo p. If the period is shorter, the expansion repeats a smaller block, and the resulting number lacks the full cyclic permutation property across all multiples up to p-1.

Full reptend primes

A , also known as a long prime, is a p for which the decimal expansion of \frac{1}{p} has a repeating of exactly p-1 digits, resulting in a repetend that forms a cyclic number. This maximal period length distinguishes these primes from others with shorter repeating cycles in their reciprocals. The smallest such prime is 7, where \frac{1}{7} = 0.\overline{142857} and the 6-digit repetend cycles through all nonzero residues modulo 7. The first fifteen full reptend primes are 7, 17, 19, 23, 29, 47, 59, 61, 97, 109, 113, 131, 149, 167, and 179. This property holds if and only if 10 is a primitive root modulo p, meaning the multiplicative order of 10 modulo p is precisely p-1. In other words, the powers of 10 modulo p generate all nonzero residues in the multiplicative group modulo p. Whether there are infinitely many full reptend primes remains an open question, though heuristics indicate this is likely the case. This infinitude is a special instance of , which posits that for any integer a neither equal to -1 nor a , there are infinitely many primes p such that a is a primitive root modulo p; here, a = 10. The conjecture, originally proposed by Emil Artin in 1927, has been partially resolved under the generalized Riemann hypothesis but remains unproven unconditionally.

Construction and Form

Generating cyclic numbers

Cyclic numbers are constructed from full reptend primes, which are primes p for which the decimal expansion of $1/p has a maximal period length of p-1 digits. The primary method to generate the cyclic number associated with such a prime p involves performing the of 1 by p and extracting the first p-1 digits of the repeating decimal portion, or repetend. This process directly yields the sequence of digits that forms the cyclic number, as the full reptend ensures the period covers exactly p-1 digits before repeating. An alternative algorithmic approach simulates the process more explicitly: begin with an initial of 1, then iteratively multiply the current by 10, divide by p to obtain the next digit as the , and take the new as the result of $10 \times previous p; continue recording digits until the returns to 1, producing the p-1 digits of the cyclic number. For example, with p = [7](/page/+7), start with remainder :
$10 \div [7](/page/+7) = [1](/page/1) (digit ), remainder $10 - [7](/page/+7) = [3](/page/3);
$30 \div [7](/page/+7) = 4 (digit 4), remainder $30 - 28 = 2;
$20 \div [7](/page/+7) = 2 (digit 2), remainder $20 - 14 = 6;
$60 \div [7](/page/+7) = 8 (digit 8), remainder $60 - 56 = 4;
$40 \div [7](/page/+7) = 5 (digit 5), remainder $40 - 35 = 5;
$50 \div [7](/page/+7) = [7](/page/+7) (digit ), remainder $50 - 49 = [1](/page/1).
The digits collected are 142857, the 6-digit cyclic number for p = [7](/page/+7).
In cases producing even-length repetends, such as for p = 17, the cyclic number may begin with a to ensure it consists of exactly p-1 = 16 digits, as seen in the repetend 0588235294117647 from $1/17. This preserves the full required for the number's cyclic properties under .

Algebraic representation

A cyclic number c corresponding to a p (also known as a long prime) in base 10 is given by the closed-form expression
c = \frac{10^{p-1} - 1}{p},
where this yields an integer whose , padded with if necessary, consists of exactly p-1 digits that form the repeating sequence in the expansion of $1/p.
The formula derives from the fact that the period of the decimal expansion of $1/p is p-1, the multiplicative order of 10 modulo p, implying $10^{p-1} \equiv 1 \pmod{p} and thus p divides $10^{p-1} - 1. This ensures c is an , and its digits (with leading zeros if the has fewer than p-1 digits) represent the full repetend. For instance, with p = [7](/page/+7),
c = \frac{10^{6} - 1}{7} = \frac{999999}{7} = 142857,
which the repeating in $1/7 = 0.\overline{142857}. In this representation, c captures the core underlying the cyclic permutations observed in multiples of the number.

Properties

Cyclic permutations in multiples

A defining property of cyclic numbers is that their multiples by integers k from 1 to d, where d is the number of digits, yield numbers that are cyclic permutations of the original digits. Specifically, for a cyclic number c associated with a p (where d = p-1), the multiple k \cdot c equals c rotated left by (k-1) positions in some cases, but more generally by a shift amount determined by the structure, considered modulo the digit length to preserve the permutation. This permutation arises because c = (10^d - 1)/p, so k \cdot c = k \cdot (10^d - 1)/p. Since k < p, k \cdot c < 10^d - 1, and the result is a d-digit number whose digits are a rearrangement of those in c. The mathematical basis relies on 10 being a primitive root modulo p, ensuring the multiplicative order of 10 modulo p is exactly d = p-1, which generates a full cycle of residues. The precise relation is captured by the congruence k \cdot c \equiv 10^{s(k)} \cdot c \pmod{10^d - 1}, where s(k) is the shift amount, specifically the discrete logarithm of k base 10 modulo p (i.e., the smallest nonnegative integer s such that $10^s \equiv k \pmod{p}). This equation holds because multiplying by $10^{s(k)} modulo $10^d - 1 corresponds to a left cyclic shift of the digits of c by s(k) positions, and the primitive root property guarantees that such an s(k) exists and is unique for each k = 1 to p-1. The underlying reason this works stems from the long division algorithm for decimals: the digits of $1/p are produced by successive remainders starting from 1, multiplied by 10 modulo p. For k/p, the process starts with remainder k, and since the remainders for $1/p cycle through all nonzero residues modulo p exactly once (due to the primitive root condition), the sequence for k/p is merely a cyclic shift of the original remainder sequence by the position where k first appears. Consequently, the digit sequence, determined by floor(10 \cdot remainder / p), shifts accordingly, producing the permutation in the multiples of c. For illustration, the multiples of the cyclic number 142857 (for p=7) demonstrate this shifting pattern.

Additional characteristics

Cyclic numbers exhibit notable divisibility properties tied to their generating . For the cyclic number 142857 associated with the prime 7, multiplication by 7 yields 999999 = $10^6 - 1, a string of six 9's, illustrating the general property. In general, a cyclic number c of period d (where d = p-1 for prime p) satisfies c \times p = 10^d - 1. A form of self-similarity arises through Midy's theorem, applicable when the period length is even. For 142857, splitting the digits into halves (142 and 857) results in their sum equaling 999, a pattern that holds for the repeating decimal expansion of $1/7. Similar truncations or substrings, such as considering 0142857 as a 7-digit sequence, do not produce cyclic behavior, as the property requires the exact period length without leading zeros or extensions. Each full reptend prime generates a unique cyclic number in base 10, with examples including 142857 from 7, 0588235294117647 from 17, and 052631578947368421 from 19. No composite numbers are known to produce cyclic numbers in base 10, as the maximal period condition typically aligns with primality. The proportion of such primes is conjectured to approach Artin's constant, approximately 0.3739558136, suggesting an infinite but sparse set of cyclic numbers. Some cyclic numbers are factors of numbers of the form $10^d - 1 in intriguing ways; for instance, $10^6 - 1 = 142857 \times 7, connecting to broader algebraic structures without direct ties to Fermat primes.

Extensions

In other number bases

The concept of cyclic numbers generalizes to arbitrary bases b > 1. In base b, a cyclic number is an with p-1 digits, where p is an prime not dividing b, such that by the integers 1 through p-1 yields cyclic permutations of its digits. This property arises when the repetend of the $1/p in base b has maximal length p-1, which occurs b is a primitive root p. The construction mirrors that in base 10: the cyclic number is the integer formed by the repeating block of digits in the base-b expansion of $1/p. For multiples k/p with $1 \leq k < p, the repetends are cyclic shifts of this block, ensuring the permutation property. This requires the multiplicative order of b p to be exactly p-1, confirming b's status as a primitive root. Examples illustrate this in non-decimal bases. In base 3, with p=7 (where 3 is a primitive root 7), the expansion of $1/7 is $0.\overline{010212}_3, and the repetend 010212 forms the cyclic number; its multiples by 1 through 6 produce rotations like 102120, 021201, and so on. Similarly, in base 13 with p=11 (13 primitive 11), the repetend of $1/11 is the 10-digit sequence 12495A8973 (where A=10), and multiples yield cyclic permutations thereof, forming a 10×10 of symbols. For any fixed odd prime p, there are infinitely many bases b in which p generates a b-cyclic number, since b is a primitive root modulo p if its residue class is one of the \phi(p-1) primitive roots, and there are infinitely many such b. Trivial cases exist in small bases; for instance, in base 2 with p=3, the repetend of $1/3 = 0.\overline{01}_2 is 01, and $2/3 = 0.\overline{10}_2 is its rotation. Cyclic numbers are connected to repunits R_d = \frac{b^d - 1}{b - 1}, where d is the length of the cyclic number, through the formula for the cyclic number c = \frac{b^d - 1}{p}, linking them via the repetend period. This relation ties cyclic numbers to the theory of primitive roots modulo primes. A prime p yields a cyclic number of length p-1 in base 10 if and only if 10 is a primitive root modulo p, meaning the multiplicative order of 10 modulo p is exactly p-1, which produces a full reptend period in the decimal expansion of $1/p. Such primes are known as full reptend primes, and their existence and density are linked to Artin's conjecture on primitive roots, which posits that for any integer a not -1 or a perfect square, a is a primitive root modulo infinitely many primes, with an asymptotic density of approximately 37% for fixed a like 10. This unsolved conjecture implies infinitely many cyclic numbers in base 10, highlighting an open problem in analytic number theory regarding the distribution of such primes. Generalizations of cyclic numbers primarily occur for primes with full reptend periods; for composite n, the period is shorter than n-1, so full cyclic permutation properties do not hold, though partial cyclic behaviors may appear in certain cases. The cyclic permutation property of these numbers resonates with concepts in , such as necklaces invariant under rotation, and in , where cyclic codes are invariant under cyclic shifts of codewords, aiding in error correction.

References

  1. [1]
    Cyclic Number -- from Wolfram MathWorld
    A cyclic number is an (n-1) -digit integer that, when multiplied by 1, 2, 3, ..., n-1 , produces the same digits in a different order.
  2. [2]
    cyclic number - PlanetMath
    Mar 22, 2013 · A cyclic number n is an integer which in a given base b maintains the same digits after repeated multiplications . For example, twice 142857 is ...Missing: mathematical | Show results with:mathematical
  3. [3]
    [PDF] A Magic Number 142857
    142857 is a cyclic number. If you multiply it by 2, 3, 4, 5 or 6, you always obtain a cyclic permutation of this number itself –. 142857 × 1 = 142857.
  4. [4]
    [PDF] The secret life of 1/n: A journey far beyond the decimal point
    If we assume the decimal expansion of 1{p has period p, why does the expansion yield a cyclic number in this way? It goes back to the fact that, under this ...
  5. [5]
    [PDF] The book of numbers / John Horton Conway, Richard K. Guy.
    Chapter 1 describes number words and symbols and Chapter 2 shows how many elementary but important facts can be discovered. "without using any mathematics." ...
  6. [6]
    [PDF] solved-and-unsolved-problems-in-number-theory-daniel-shanks.pdf
    “number theory is very much a live subject.” These two facts are in conflict fifteen years later. Considerable updating is desirable at many.
  7. [7]
    Full Reptend Prime -- from Wolfram MathWorld
    (OEIS A004042) corresponding to the periodic parts of these decimal expansions are called cyclic numbers. No general method is known for finding full reptend ...
  8. [8]
    full reptend prime - PlanetMath.org
    Mar 22, 2013 · For example, the case b=10 b = 10 , p=7 p = 7 gives the cyclic number 142857, thus, 7 is a full reptend prime. Not all values of p p will yield ...
  9. [9]
    Artin's Constant -- from Wolfram MathWorld
    Let n be a positive nonsquare integer. Then Artin conjectured that the set S(n) of all primes for which n is a primitive root is infinite.
  10. [10]
  11. [11]
    [PDF] Cyclic Number - Santanu Bandyopadhyay
    Feb 10, 2020 · A cyclic number has an unusually interesting property. If you multiply a cyclic number, by 1 through n (where n is the number of digits of ...Missing: definition | Show results with:definition
  12. [12]
    A001913 - OEIS
    A001913 - OEIS. Full reptend primes: primes with primitive root 10. Primes p such that the decimal expansion of 1/p has period p-1, which is the greatest ...Missing: formula | Show results with:formula
  13. [13]
    [PDF] arXiv:math/0605347v1 [math.NT] 12 May 2006
    the missing 5 digits are placed as to get a rotation of the original period. ... Therefore, we say that 7 generates the 3-cyclic number (010212)3.
  14. [14]
    [PDF] 142857, and more numbers like it - John Kerl's home page
    Jan 4, 2012 · That is, when do k/n's have the longest possible period in base-b expansion, with digits for each fraction being cyclic permutations of one.
  15. [15]
    [PDF] Cyclic Numbers and Latin Squares - Samin Riasat
    These permutations are all powers of (123456) or (165432), in accordance with the fact that 3 and 5 are primitive roots modulo 7. In general, if p is an odd ...
  16. [16]
    [PDF] Cyclic numbers
    (1000000 - 1)/7 = 1 × 999999/7 = 142857. (2000000 - 2)/7 = 2 × 999999/7 = 285714. (3000000 - 3)/7 = 3 × 999999/7 = 428571. (4000000 - 4)/7 = 4 × 999999/7 = ...
  17. [17]
    Primitive Root -- from Wolfram MathWorld
    A primitive root of a prime p is an integer g such that g (mod p ) has multiplicative order p-1 (Ribenboim 1996, p. 22).<|separator|>
  18. [18]
    [PDF] Necklaces over a group with identity product - arXiv
    Oct 21, 2024 · Formally, they are defined as orbits (i.e., equivalence classes) of n-tuples under cyclic rotation. They can be visualized as labellings (or ...
  19. [19]
    [PDF] Cyclic Codes
    Let C be a cyclic code of length n over. K with generator polynomial g(x). Suppose that g(αj+b)=0, for some fixed b and 1 ≤ j ≤ t, where α is a primitive nth ...
  20. [20]
    My C++ solution for Project Euler 358: Cyclic numbers
    Oct 26, 2017 · The next cyclic number is 0588235294117647 with 16 digits : ... The next reptend prime is 17. And it verifies the second example: c ...