The digits of some specific integers permute or shift cyclically when they are multiplied by a number n. Examples are:
Contents
- General
- Integral multiplier
- Fractional multiplier
- Direct representation
- Cyclic permutation by multiplication
- Proof of formula for cyclical right shift operation
- Proof of formula for cyclical left shift operation
- Shifting an integer cyclically
- Parasitic numbers
- Shifting right cyclically by double positions
- Summary of results
- Shifting left cyclically by single position
- Shifting left cyclically by double positions
- Other bases
- References
These specific integers, known as transposable integers, can be but are not always cyclic numbers. The characterization of such numbers can be done using repeating decimals (and thus the related fractions), or directly.
General
For any integer coprime to 10, its reciprocal is a repeating decimal without any non-recurring digits. E.g. 1⁄143 = 0.006993006993006993...
While the expression of a single series with vinculum on top is adequate, the intention of the above expression is to show that the six cyclic permutations of 006993 can be obtained from this repeating decimal if we select six consecutive digits from the repeating decimal starting from different digits.
This illustrates that cyclic permutations are somehow related to repeating decimals and the corresponding fractions.
The greatest common divisor (gcd) between any cyclic permutation of an m-digit integer and 10m − 1 is constant. Expressed as a formula,
where N is an m-digit integer; and Nc is any cyclic permutation of N.
For example,
gcd(091575, 999999) = gcd(32×52×11×37, 33×7×11×13×37) = 3663 = gcd(915750, 999999) = gcd(157509, 999999) = gcd(575091, 999999) = gcd(750915, 999999) = gcd(509157, 999999)If N is an m-digit integer, the number Nc, obtained by shifting N to the left cyclically, can be obtained from:
where d is the first digit of N and m is the number of digits.
This explains the above common gcd and the phenomenon is true in any base if 10 is replaced by b, the base.
The cyclic permutations are thus related to repeating decimals, the corresponding fractions, and divisors of 10m−1. For examples the related fractions to the above cyclic permutations are thus:
Reduced to their lowest terms using the common gcd, they are:
That is, these fractions when expressed in lowest terms, have the same denominator. This is true for cyclic permutations of any integer.
Integral multiplier
An integral multiplier refers to the multiplier n being an integer:
- An integer X shift right cyclically by k positions when it is multiplied by an integer n. X is then the repeating digits of 1⁄F, whereby F is F0 = n 10k − 1 (F0 is coprime to 10), or a factor of F0; excluding any values of F which are not more than n.
- An integer X shift left cyclically by k positions when it is multiplied by an integer n. X is then the repeating digits of 1⁄F, whereby F is F0 = 10k - n, or a factor of F0; excluding any values of F which are not more than n and which are not coprime to 10.
It is necessary for F to be coprime to 10 in order that 1⁄F is a repeating decimal without any preceding non-repeating digits (see multiple sections of Repeating decimal). If there are digits not in a period, then there is no corresponding solution.
For these two cases, multiples of X, i.e. (j X) are also solutions provided that the integer i satisfies the condition n j⁄F < 1. Most often it is convenient to choose the smallest F that fits the above. The solutions can be expressed by the formula:
To exclude integers that begin with zeros from the solutions, select an integer j such that j⁄F > 1⁄10, i.e. j > F⁄10.
There is no solution when n > F.
Fractional multiplier
An integer X shift left cyclically by k positions when it is multiplied by a fraction n⁄s. X is then the repeating digits of s⁄F, whereby F is F0 = s 10k - n, or a factor of F0; and F must be coprime to 10.
For this third case, multiples of X, i.e. (j X) are again solutions but the condition to be satisfied for integer j is that n j⁄F < 1. Again it is convenient to choose the smallest F that fits the above.
The solutions can be expressed by the formula:
To exclude integers that begin with zeros from the solutions, select an integer j such that j s⁄F > 1⁄10, i.e. j > F⁄10s.
Again if j s⁄F > 1, there is no solution.
Direct representation
The direct algebra approach to the above cases integral multiplier lead to the following formula:
-
X = D 10 m − 1 n 10 k − 1 , where m is the number of digits of X, and D, the k-digit number shifted from the low end of X to the high end of n X, satisfies D < 10k.If the numbers are not to have leading zeros, then n 10k − 1 ≤ D. -
X = D 10 m − 1 10 k − n , where m is the number of digits of X, and D, the k-digit number shifted from the high end of X to the low end of n X, satisfies:-
D < 10 k n − 1 , - and the 10-part (the product of the terms corresponding to the primes 2 and 5 of the factorization) of 10k − n divides D.The 10-part of an integer t is often abbreviated
gcd ( 10 ∞ , t ) .
-
Cyclic permutation by multiplication
A long division of 1 by 7 gives:
0.142857... 7 ) 1.000000 .7 3 28 2 14 6 56 4 35 5 49 1At the last step, 1 reappears as the remainder. The cyclic remainders are {1, 3, 2, 6, 4, 5}. We rewrite the quotients with the corresponding dividend/remainders above them at all the steps:
Dividend/Remainders 1 3 2 6 4 5 Quotients 1 4 2 8 5 7and also note that:
By observing the remainders at each step, we can thus perform a desired cyclic permutation by multiplication. E.g.,
In this manner, cyclical left or right shift of any number of positions can be performed.
Less importantly, this technique can be applied to any integer to shift cyclically right or left by any given number of places for the following reason:
Proof of formula for cyclical right shift operation
An integer X shift cyclically right by k positions when it is multiplied by an integer n. Prove its formula.
Proof
First recognize that X is the repeating digits of a repeating decimal, which always possesses cyclic behavior in multiplication. The integer X and its multiple n X then will have the following relationship:
- The integer X is the repeating digits of the fraction 1⁄F, say dpdp-1...d3d2d1, where dp, dp-1, ..., d3, d2 and d1 each represents a digit and p is the number of digits.
- The multiple n X is thus the repeating digits of the fraction n⁄F, say dkdk-1...d3d2d1dpdp-1...dk+2dk+1, representing the results after right cyclical shift of k positions.
- F must be coprime to 10 so that when 1⁄F is expressed in decimal there is no preceding non-repeating digits otherwise the repeating decimal does not possesses cyclic behavior in multiplication.
- If the first remainder is taken to be n then 1 shall be the (k + 1)th remainder in the long division for n⁄F in order for this cyclic permutation to take place.
- In order that n × 10k = 1 (mod F) then F shall be either F0 = (n × 10k - 1), or a factor of F0; but excluding any values not more than n and any value having a nontrivial common factor with 10, as deduced above.
This completes the proof.
Proof of formula for cyclical left shift operation
An integer X shift cyclically left by k positions when it is multiplied by an integer n. Prove its formula.
Proof
First recognize that X is the repeating digits of a repeating decimal, which always possesses a cyclic behavior in multiplication. The integer X and its multiple n X then will have the following relationship:
- The integer X is the repeating digits of the fraction 1⁄F, say dpdp-1...d3d2d1 .
- The multiple n X is thus the repeating digits of the fraction n⁄F, say dp-kdp-k-1...d3d2d1dpdp-1...dp-k+1,
which represents the results after left cyclical shift of k positions.
- F must be coprime to 10 so that 1⁄F has no preceding non-repeating digits otherwise the repeating decimal does not possesses cyclic behavior in multiplication.
- If the first remainder is taken to be 1 then n shall be the (k + 1)th remainder in the long division for 1⁄F in order for this cyclic permutation to take place.
- In order that 1 × 10k = n (mode F) then F shall be either F0 = (10k -n), or a factor of F0; but excluding any value not more than n, and any value having a nontrivial common factor with 10, as deduced above.
This completes the proof. The proof for non-integral multiplier such as n⁄s can be derived in a similar way and is not documented here.
Shifting an integer cyclically
The permutations can be:
Parasitic numbers
When a parasitic number is multiplied by n, not only it exhibits the cyclic behavior but the permutation is such that the last digit of the parasitic number now becomes the first digit of the multiple. For example, 102564 x 4 = 410256. Note that 102564 is the repeating digits of 4⁄39 and 410256 the repeating digits of 16⁄39.
Shifting right cyclically by double positions
An integer X shift right cyclically by double positions when it is multiplied by an integer n. X is then the repeating digits of 1⁄F, whereby F = n × 102 - 1; or a factor of it; but excluding values for which 1⁄F has a period length dividing 2 (or, equivalently, less than 3); and F must be coprime to 10.
Most often it is convenient to choose the smallest F that fits the above.
Summary of results
The following multiplication moves the last two digits of each original integer to the first two digits and shift every other digits to the right:
Note that:
There are many other possibilities.
Shifting left cyclically by single position
Problem: An integer X shift left cyclically by single position when it is multiplied by 3. Find X.
Solution: First recognize that X is the repeating digits of a repeating decimal, which always possesses some interesting cyclic behavior in multiplications. The integer X and its multiple then will have the following relationship:
This yields the results that:
X = the repeating digits of 1⁄7=142857, andthe multiple = 142857 × 3 = 428571, the repeating digits of 3⁄7The other solution is represented by 2⁄7 x 3 = 6⁄7:
There are no other solutions because:
However, if the multiplier is not restricted to be an integer (though ugly), there are many other solutions from this method. E.g., if an integer X shift right cyclically by single position when it is multiplied by 3⁄2, then 3 shall be the next remainder after 2 in a long division of a fraction 2⁄F. This deduces that F = 2 x 10 - 3 = 17, giving X as the repeating digits of 2⁄17, i.e. 1176470588235294, and its multiple is 1764705882352941.
The following summarizes some of the results found in this manner:
Shifting left cyclically by double positions
An integer X shift left cyclically by double positions when it is multiplied by an integer n. X is then the repeating digits of 1⁄F, whereby F is R = 102 - n, or a factor of R; excluding values of F for which 1⁄F has a period length dividing 2 (or, equivalently, less than 3); and F must be coprime to 10.
Most often it is convenient to choose the smallest F that fits the above.
Summary of results
The following summarizes some of the results obtained in this manner, where the white spaces between the digits divide the digits into 10-digit groups:
Other bases
In duodecimal system, the transposable integers are: (using inverted two and three for ten and eleven, respectively)