Multiples and Digit Reversals

 

It is not yet the worst so long as we can say “This is the worst”.

 

A well-known puzzle asks for an integer with decimal digits a,b,c,d that is divisible by the number with reversed digits, d,c,b,a. It isn’t difficult to show that the two occurrences of this are 4*2178 = 8712 and 9*1089 = 9801. Here we’ll discuss how these examples are related to each other, and how they fit into a larger pattern. Notice that the numbers 2178 and 8712 can be written as

 

 

This makes it clear that 8712 is just 4 times 2178. Similarly, we have

 

 

which shows that 9801 is just 9 times 1089. Now suppose we place some “9” digits in the middle of these numbers.  For example, consider the number 2199978 and its digit reversal 8799912. These numbers can be written as

 

 

So, it’s clear that we can place any number of “9” digits into the middle of these numbers, and the resulting numbers will always be in the ratio 4:1. Likewise, we can insert “9”s into the middle of 1089 and 9801, and the resulting numbers will always be in the ratio 9:1.

 

We can also “stack” these solutions. For example, 21782178 * 4 = 87128712, and with arbitrary “9”s inserted we have identities such as 219978219978 * 4 = 879912879912.

 

We can find 4-digit examples of this same type of solution in other bases just by examining the complementary pairs. In the base 9 we consider 1078, 2167, 3256, 4345, and so on, and solutions are given when the LSD divides the MSD. In this case, 1078 has k=8 and 3256 has k=2. Writing all numbers in base 9, the second of these examples, 3256*2 = 6523, satisfies the relations

 

 

So far, all our examples involved repeated digits in the resolved expressions, and were complements in the base, but solutions need not satisfy this condition. For example, in base 11 we have 7*1298 = 8921, and the relations, with all numbers expressed in base 11, and with character A for decimal 10, are

 

 

Another more general example in base 11 is 3 * 1694 = 4961.  These solutions are still of the form h(B2 – 1) and kh(B2 – 1).

 

One convenient way of identifying such solutions is to note that with the four digits a,b,c,d in the base B we have the three conditions

 

 

In matrix form, for any given base B, factor k, and leading digit “a”, we can write

 

 

Solving this system, we get

 

 

With this we can quickly identify the integer solutions of this type in any given base.  Clearly for any base B and k=B-1 we have the solution [1][0][B-2][B-1]. In addition, there are other solutions for most bases. For example, in the base B=19 we have

 

 

We can also parameterize infinite families of solutions, such as the most common case given by [a][a-1][B-a-1][B-a] where “a” is any digit given by B/(k+1). With B=10 and k=4, this gives 2,1,7,8, which was our original example.

 

Another infinite family of solutions, all with k=3, is parameterized as [a][5a+1][B-a-1][3a+1] with a = (B-3)/8. For example, with B=19 we have the solution 2,11,16,7. Still another infinite family of solutions, all with k=4, is given by [a][11a+5][B-a-1][4a+2] with a = (B-8)/15. For example, with B=23 we have the solution 1,16,21,6.

 

For any given k, the solutions fall into several infinite families that can easily be expressed parametrically. With k=2 we have the infinite family of solutions

 

 

with j=0,1,2,…   With k=3 we have two infinite families of solutions

 

 

With k=4 we have three families of solutions

 

 

The first of these families, with j=1, gives the well-known base-10 solution 2178. With k=5 we have the three families of solutions shown below.

 

 

Similarly, for k=6 we have five families of solutions

 

 

For k=7 we have the five families of solutions

 

 

For k=8 we have the five families of solutions

 

 

Note that B1 = a+c = b+d, and that the periods of B are always divisors of k2 – 1. Also, as we would expect, the coefficient of j in d is always k times the coefficient of j in a.

 

The lower-most family for each value of k falls into a regular pattern that can be parameterized as follows:

 

 

For example, with k=8 this gives B=9+9j, and so on. With these parametric expressions we have identically

 

 

and the value of the digit-reversed number “dcba” = a + bB + cB2 + dB3 is identically k times this. We also have

 

 

This confirms that “abcd” = (“ab”+1)(B2 – 1), and k times this is “dcba” = (“dc”+1)(B2 – 1).

 

In general, for all such “self-complementary” solution (which are a subset of all solutions) we have

 

 

Note that the first of these implies a+c = b+d = B1. Under these condition, we can write

 

 

Similarly we can show that

 

 

So we have a solution in view of the condition “dc”+1 = k(“ab”+1).

 

We discussed above the family of the lowest families.  At the other extreme, the upper-most family for each value of k falls into a regular pattern that can be parameterized as follows:

 

 

For example, with k=8 this gives B=111+63j, and so on. With these parametric expressions we have identically

 

 

and the value of the digit-reversed number a + bB + cB2 + dB3 is identically k times this. We also have

 

 

This confirms that, for this family of families, we have

 

 

where

 

We can identify other infinite families of families as well. For example, for even values of k=2,4,6,8,…we have solutions that fall into a regular pattern that can be parameterized as

 

 

For example, with k=8 this gives B=69+63j, and so on. With these parametric expressions we have identically

 

 

and the value of the digit-reversed number “dcba” is identically k times this. We also have

 

 

For another example, for even values of k=4,6,8,10… we have solutions that fall into a regular pattern that can be parameterized as

 

 

For example, with k=8 this gives B=83+63j, and so on. With these parametric expressions we have identically

 

 

and the value of the digit-reversed number “dcba” is identically k times this. We also have

 

 

For one last example, for even values of k=6,8,10,12… we have solutions that fall into a regular pattern that can be parameterized as

 

 

For example, with k=8 this gives B=41+63j, and so on. With these parametric expressions we have identically

 

 

and the value of the digit-reversed number “dcba” is identically k times this. We also have

 

 

The preceding discussion has focused on a special class of solutions involving just 4-digit numbers. The general algebraic condition for an s+1 digit number N in the base B to satisfy the relation N = k rev(N) can be written as

 

 

An example in the base B=8 with k=5 is given by 5(11165) = 56111.

 

In general, letting dj denote the jth digit of N, and letting cj denote the jth carry in the multiplication, a 4-digit solution entails the following conditions

 

 

Notice that for any given values of the carries we can solve for the digits, since the first and last conditions involve d0 and d3, and the two middle conditions involve d1 and d2. Thus we have

 

 

We also know that every carry is less than k, as can be seen from the example k=4 in the base 10, which shows that with the maximum possible digit 9, the product is only 36, and even with a feeding maximum carry of 3, this is still only 39, so the maximum carry going forward can’t exceed 3 (with k=4). The same argument applies to other bases B and multipliers k.

 

In our original 4-digit example with B=10 and k=4 the first matrix equation yields the requirements

 

 

Clearly c0 can’t be zero because the digits would be negative or zero, and it’s easily seen that with c0 equal to 1 or 2 we do not get integer digits for any c2 less than k. With c0=3 we get the only possible solution with c2=0, which gives d0=8 and d3=2. The other matrix equation can then be examined, and it’s easily seen that the only possible solution is with c1=3, which gives d1=7 and d2=1, confirming that 2178 is the unique 4-digit solution with B=10 and k=4.

 

The same approach can be applied to solutions with any number of digits. For example, the governing equations for 6-digit numbers are

 

 

Taking these in pairs, the first and last can be used to solve for d0, d5 in terms of c0 and c4, and the 2nd and 5th can be used to solve for d1, d4, for further values of c1 and c3, and so on. This gives the relations

 

 

Stepping through these pairs, one at a time, we can find the viable solutions (if any) at each stage, and then extend those to the next stages. There may be more than one solution at each stage (or none), we get a tree structure. We are basically starting from the outer (first and last digits) and working our way inwards to the center of the number. In this way we can map out all possible solutions for any given B and k.

 

For example, for 6-digit solutions with B=8, k=5 we find that the only pair of carries (c0,c4) that yield integer results for the first matrix equation above is (3,0), and with this the only two pairs of carries (c1,c3) are (1,1) and (4,1), and for these the only remaining carry (c2) is (3) and (4) respectively. From the digit values we get the only solutions 102515 and 112665 respectively. The latter solution is analogous to the special class of 4-digit solutions discussed previously, since the digits of the number “abcdef” = 112665 (in base B=8) satisfy

 

 

Hence we also have a+d = b+e = c+f = B1, and

 

 

It’s interesting to examine the base polynomials in B of solutions. For example, the solution 102515 for k=5 in the base 8 corresponds to the polynomial

 

 

The ratio equals k, so we have

 

 

This is consistent with the fact that B=8, and shows that we would also have a formal solution with the “radix” B = -3.

 

The base polynomials of a self-complementary solution with 6 digits all seem to be divisible by (B3-1)/(B-1) = B2 + B + 1. For example, the solution 112665 with k=5 and B=8 discussed above has the base polynomial factorization

 

 

Clearly the factors of the reverse polynomial are just the reverse of the factors of the forward polynomial. We see the second factors of these polynomials are the same as for the previous example. They differ only by the extra B in the first factors.

 

It’s possible to have multiple solutions for a given B and k, even if we restrict ourselves to self-complementary solutions. For example, in the base B=31 with k=7 we have the solutions [1][11][21][29][19][9] and [2][19][12][28][11][18]. The first of these is somewhat unusual, in that the digits are in arithmetic progressions (1,11,10 and 9,19,29), and this special quality shows up in the base polynomials

 

 

The characteristic factor B2 + B + 1 appears squared, the same forward and reversed, so for k=7 we have 9B+1 = 7(B+9), which has just the single solution B=31. As with the 4-digit self-complementary solutions, we can insert any number of [B-1] digits into the middle of these solutions.

 

For just one more self-complementary example, with B=27 and k=3 we have a solution with base polynomial

 

 

This happens to have both of the reversible characteristic factors, so with k=3 the divisibility condition reduces to 3(3B+10)=10B+3 with the unique solution B=27.

 

These results suggest a simple way of generating more solutions of a given type. For example, to produce another 6-digit solution with digits in matched arithmetic progressions, the base polynomial would consist of (B2+B+1)2 multiplied by a simple linear factor. If we choose a simple factor of the form mB+n we must select m and n such that k(mB+n)=(m+nB) and hence B=(kn-m)/(n-km) is an integer. To illustrate, with k=5 we can choose m=1,n=6, which gives B=29, and we have the solution with digits given by

 

 

This is not a self-complementary solution, since a+d, b+e, and c+f all equal 21 rather than 28. So, we can’t simply insert [B-1] digits into the middle of this solution, as we can for the self-complementary solutions.

 

Rouse Ball mentioned the original “2178” puzzle in his “Mathematical Recreations”, and it was also mentioned by the British mathematician Godfrey Hardy in his 1940 memoir “A Mathematician’s Apology” as an example of something that isn’t mathematically interesting, because he felt it lacked any kind of deep generality. (Hardy proudly asserted that he had never done anything of practical use in his life, and yet the frequency with which he discussed the worthiness, practicality, and usefulness of mathematics makes it seem as if he had doubts about the value of his life’s efforts in such “useless” subjects. He lived a very uneventful life, and said the one romantic episode of his life was his association with the Indian savant Ramanujan.)

 

There’s always been a strange prejudice about the mathematical structure of the radix representation of numbers. This may be partly due to the fact that propositions of this kind are often expressed in base 10, and are perceived as being artificial for that reason, even though such propositions are almost always generally applicable to arbitrary bases. The fundamental structure of the unique representation of numbers by radix expressions is actually quite interesting, since it is superficially simple and yet involves non-linearities that thwart treatment with purely elementary algebraic operations. Some of the prejudice may be due to a perception that radix systems do not (and could not) occur in nature, they are entirely and uniquely an artificial man-made conceptual tool. This may or may not be true – are there any phenomena in nature that involve something analogous to the modulo-plus-carry operations? If there are, that would be quite interesting, and if there are not, that too would be quite interesting, i.e., that this fairly ubiquitous tool and conceptual structure (invented around the time of the Renaissance in Europe) is a unique construction of the human mind with no counterpart in non-human nature. This is quite rate, i.e., things like lasers and nuclear power and radio (and fire and the wheel) are all discoveries and exploitations of phenomena that occur in nature, so they are not original creations of humans. In contrast, it’s been said that only humans have exploited things such as prime number factorization, the study of which is regarded as one of the most profound branches of mathematics. If radix representations are also in this rare category of uniquely human conceptual structures, this alone would make them quite interesting.

 

Return to MathPages Main Menu