*** Welcome to piglix ***

Cyclic number


A cyclic number is an integer in which cyclic permutations of the digits are successive multiples of the number. The most widely known is 142857:

To qualify as a cyclic number, it is required that consecutive multiples be cyclic permutations. Thus, the number 076923 would not be considered a cyclic number, because even though all cyclic permutations are multiples, they are not consecutive integer multiples:

The following trivial cases are typically excluded:

If leading zeros are not permitted on numerals, then 142857 is the only cyclic number in decimal, due to the necessary structure given in the next section. Allowing leading zeros, the sequence of cyclic numbers begins:

Cyclic numbers are related to the recurring digital representations of unit fractions. A cyclic number of length L is the digital representation of

Conversely, if the digital period of 1 /p (where p is prime) is

then the digits represent a cyclic number.

For example:

Multiples of these fractions exhibit cyclic permutation:

From the relation to unit fractions, it can be shown that cyclic numbers are of the form of the Fermat quotient

where b is the number base (10 for decimal), and p is a prime that does not divide b. (Primes p that give cyclic numbers in base b are called full reptend primes or long primes in base b).

For example, the case b = 10, p = 7 gives the cyclic number 142857, and the case b = 12, p = 5 gives the cyclic number 2497.

Not all values of p will yield a cyclic number using this formula; for example, the case b = 10, p = 13 gives 076923076923, and the case b = 12, p = 19 gives 076B45076B45076B45. These failed cases will always contain a repetition of digits (possibly several).

The first values of p for which this formula produces cyclic numbers in decimal (b = 10) are (sequence in the OEIS)


...
Wikipedia

...