This article is about numbers where permutations of their digits (in some base) yield related numbers. For the number theoretic concept, see cyclic number (group theory).
A cyclic number is an integer for which cyclic permutations of the digits are successive integer multiples of the number. The most widely known is the six-digit number 142857, whose first six integer multiples are
142857 × 1 = 142857
142857 × 2 = 285714
142857 × 3 = 428571
142857 × 4 = 571428
142857 × 5 = 714285
142857 × 6 = 857142
Details
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:
076923 × 1 = 076923
076923 × 3 = 230769
076923 × 4 = 307692
076923 × 9 = 692307
076923 × 10 = 769230
076923 × 12 = 923076
The following trivial cases are typically excluded:
single digits, e.g.: 5
repeated digits, e.g.: 555
repeated cyclic numbers, e.g.: 142857142857
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:
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 A001913 in the OEIS)
This procedure works by computing the digits of 1/p in base b, by long division. r is the remainder at each step, and d is the digit produced.
The step
n = n ⋅ b + d
serves simply to collect the digits. For computers not capable of expressing very large integers, the digits may be output or collected in another way.
If t ever exceeds p/2, then the number must be cyclic, without the need to compute the remaining digits.
Properties of cyclic numbers
When multiplied by their generating prime, the result is a sequence of b − 1 digits, where b is the base (e.g. 10 in decimal). For example, in decimal, 142857 × 7 = 999999.
When split into groups of equal length (of two, three, four, etc... digits), and the groups are added, the result is a sequence of b - 1 digits. For example, 14 + 28 + 57 = 99, 142 + 857 = 999, 1428 + 5714+ 2857 = 9999, etc. ... This is a special case of Midy's Theorem.
All cyclic numbers are divisible by b − 1 where b is the base (e.g. 9 in decimal) and the sum of the remainder is a multiple of the divisor. (This follows from the previous point.)
Other numeric bases
Using the above technique, cyclic numbers can be found in other numeric bases. (Not all of these follow the second rule (all successive multiples being cyclic permutations) listed in the Special Cases section above) In each of these cases, the digits across half the period add up to the base minus one. Thus for binary, the sum of the bits across half the period is 1; for ternary, it is 2, and so on.
In binary, the sequence of cyclic numbers begins: (sequence A001122 in the OEIS)
In ternary (b = 3), the case p = 2 yields 1 as a cyclic number. While single digits may be considered trivial cases, it may be useful for completeness of the theory to consider them only when they are generated in this way.
It can be shown that no cyclic numbers (other than trivial single digits, i.e. p = 2) exist in any numeric base which is a perfect square, that is, base 4, 9, 16, 25, etc.
Gardner, Martin. Mathematical Circus: More Puzzles, Games, Paradoxes and Other Mathematical Entertainments From Scientific American. New York: The Mathematical Association of America, 1979. pp. 111–122.
Kalman, Dan; 'Fractions with Cycling Digit Patterns' The College Mathematics Journal, Vol. 27, No. 2. (Mar., 1996), pp. 109–115.
Leslie, John. "The Philosophy of Arithmetic: Exhibiting a Progressive View of the Theory and Practice of ....", Longman, Hurst, Rees, Orme, and Brown, 1820, ISBN1-4020-1546-1