where #d indicates the number of appearances of the digit d in n. There are 4 other equations of a similar nature that can be formulated for the other digits. Similarly, we can count the number of places where there was a carry between digits. A carry occurs in every digit of n that is greater or equal to 5. On the other hand, only in those places where there was a carry will the next digit in 2n be odd. This would have lead to the equation
if n and 2n were digit anagrams of each other.
In part 1 of the riddle, it is n and 2n-1 that are anagrams, but we also know that n's least significant digit is 3, meaning that by subtracting one we are, in effect, making the number of "6" digits smaller by one and the number of "5" digits larger by one on the right-hand-side of the equations. Ultimately, we reach the following set of linear equations:
Consider, for example, the linear combination D+F-A-C-E of these equations. It yields
If there were no "8"s in n, this equation would have indicated that either the number of "2"s or the number of "7"s is negative, which is, of course, impossible.
If n and 2n are digit anagrams of each other, there are several ways of finding from them new number pairs, l and 2l, that also satisfy that l and 2l are digit anagrams. For example, one can add zero digits between any two digits of n that don't have carry between them when multiplied by two. Alternatively, one can add a "9" between any two digits that do pass a carry digit between them. Finally, one can concatenate the digits of any two solutions to get a new valid solution.
Of these, we will consider multiple concatentations of the same solution and adding a zero in the place of the least significant digit, both of which cause the original number to be multiplied by a known factor.
We'll begin with the arbitrarily chosen solution n=125874.
Note that for any integers a≥0 and b>0, n 10a (1000000b-1) / 999999 is a number that becomes an anagram of itself when multiplied by two. Now, let us divide m into three parts: m=2t 5f r, where r is divisible by neither 2 nor 5. Clearly, if a=max(t,f) then 10a is a multiple of 2t 5f. If r=1, we can choose k=n 10a/m and we are done. Otherwise, let us use Euler's theorem, which states that for any relativley prime x and y, xφ(y)=1 (mod y), where φ denotes Euler's phi function. So, choosing x=1000000 and y=999999 r, we get 1000000φ(999999 r)=1 (mod 999999 r). Alternatively, choosing b=φ(999999 r), we get that (1000000b-1) is divisible by 999999 r and that (1000000b-1) / 999999 is divisible by r. Therefore, n 10a (1000000b-1) / 999999 is a multiple of m and choosing k=n 10a (1000000b-1) / (999999 m) yields a valid solution.
Back to riddle
Back to main page