💾 Archived View for jsreed5.org › math › 20240119-doubling-by-reversing › index.gmi captured on 2024-05-26 at 14:46:06. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2024-02-05)
-=-=-=-=-=-=-
Download a PostScript version of this document
(PS, 368 KB)
--
A while ago, it occurred to me that reversing the digits of the number 37 gave a number that was almost double its value:
73=37*2-1 73/37=1.(972)
I began to wonder if a integer n>9 existed such that if m is created by reversing the digits of n, m=2n.
As is often the case, my first approach was based in analysis. I looked at the two-digit case by examining one equation in two unknown integers 0≤(a,b)≤9:
m=10a+b, n=10b+a m/n=(10a+b)/(10b+a)=2 8a=19b
Clearly this equation has no solutions with the given restrictions on a and b. This was sufficient to show that no two-digit numbers have the desired property.
The three-digit case is more complicated but works similarly:
m=100a+10b+c, n=100c+10b+a m/n=(100a+10b+c)/(100c+10b+a)=2 98a-10b=199c
The only solution to this equation with 0\leq c<a\leq 9 is:
a=6, b=19, c=2
Thus there are no three-digit numbers with the desired property either.
Given a fixed number of digits d, we could use this analytical approach to create an equation with d unknowns and examine a finite number of solutions to that equation. However, it doesn't give us a general rule for all numbers, regardless of how many digits they have. We need a different approach--and in this case, we turn to simple arithmetic.
For ease, we denote the first (greatest-value) digit of a positive integer a as a_first. Similarly, we denote the last (least-value) digit of a as a_last. We also define rev(a_b) as the positive integer c_b whose digits are the reverse of the digits of a, ignoring leading zeroes. (When b is omitted, we assume base 10.)
Fix an arbitrary integer n>9. Suppose m=2n=rev(n); we examine the properties of the first and last digits of m and n to see if such an m can exist.
Since m=2n, m is even, so m_last must be even, and n_first is also even. Further, n_first<5; otherwise 2n would have an extra digit. Thus n_first is either 2 or 4. m_last cannot be 0 because rev(n) ignores leading zeroes in n, so n_last cannot be 0 or 5.
Suppose n_first=2; then m_last=2, and m_first is either 4 or 5, depending on if doubling n caused a carry. It cannot be 5, since n_last would then be 5, so it must be 4. But then n_last=4, and (2n)_last=m_last=8--a contradiction. Alternatively, if n_first=4, then m_last=4, and m_first is either 8 or 9, depending on if doubling n caused a carry. Then n_last must be 8 or 9. But if n_last=8, (2n)_last=m_last=6, and if n_last=9, (2n)_last=m_last=8--another contradiction.
Therefore, no m exists such that m=2n=rev(n).
While no base-10 integer yields its exact double when its digits are reversed, many numbers come relatively close. 73/37, the first example, is off by only 1.35%. The following table contains the twenty positive integers less than 100000000 that come (relatively) closest to doubling.
+--------+-------------+----------------------+ | n | rev(n)/n | % Error | +--------+-------------+----------------------+ +--------+-------------+----------------------+ |39999997|2-1/39999997 | 0.00000125000009375 | +--------+-------------+----------------------+ |29999995|2+2/29999995 |0.00000333333388888898| +--------+-------------+----------------------+ |49999999|2-4/49999999 | 0.00000400000008 | +--------+-------------+----------------------+ |46000029|2+6/46000029 |0.00000652173501890618| +--------+-------------+----------------------+ |42999958|2+4/21499979 |0.00000930233466739665| +--------+-------------+----------------------+ |36000027| 2+1/4000003 |0.00001249999062500703| +--------+-------------+----------------------+ |19999993|2+5/19999993 |0.00001250000437500153| +--------+-------------+----------------------+ |3999997 |2-1/39999997 |0.00001250000937500703| +--------+-------------+----------------------+ |10000002| 2-1/3333334 |0.00001499999700000059| +--------+-------------+----------------------+ |20000004| 2-1/3333334 |0.00001499999700000059| +--------+-------------+----------------------+ |30000006| 2-1/3333334 |0.00001499999700000059| +--------+-------------+----------------------+ |40000008| 2-1/3333334 |0.00001499999700000059| +--------+-------------+----------------------+ |32999956| 2+1/2999996 |0.00001666668888891851| +--------+-------------+----------------------+ |26000025| 2+4/8666675 |0.0000230769008875953 | +--------+-------------+----------------------+ |43999978| 2-1/1999999 |0.00002500001250000625| +--------+-------------+----------------------+ |47000049|2-8/15666683 |0.00002553188827526541| +--------+-------------+----------------------+ |48999979|2+26/48999979|0.00002653062361516522| +--------+-------------+----------------------+ |33999976|2-19/33999976|0.00002794119619378554| +--------+-------------+----------------------+ |37000047| 2-1/1761907 |0.00002837834233021379| +--------+-------------+----------------------+ |22999954|2+7/11499977 |0.0000304348434783826 | +--------+-------------+----------------------+
These numbers have some common properties. Each consists of two outer blocks of digits and an inner block containing either all 0s or all 9s. Starting from the outside in, each digit of the first outer block is doubled in the second outer block, sometimes with 1 added to it. The inner block's contents are determined by the need to carry: if the first digit of the second outer block is odd, a carry is present when doubling, and the inner block contains 9s to propagate the carry. Otherwise the inner block contains 0s. When more digits are present, these patterns may repeat themselves, but each iteration contains the same basic structure.
While the preceding numbers are structured similarly, there isn't a trivial pattern to the digits themselves. In contrast, a strong pattern appears when considering the d-digit integer that comes closest to doubling for each d:
+-+--------+ |d| n | +-+--------+ +-+--------+ |2| 37 | +-+--------+ |3| 397 | +-+--------+ |4| 3997 | +-+--------+ |5| 39997 | +-+--------+ |6| 399997 | +-+--------+ |7|3999997 | +-+--------+ |8|39999997| +-+--------+
These "best" numbers are of the form:
n_d=4*10^(d-1)-3, d>1
Reversing them creates:
rev(n_d)=8*10^(d-1)-7
Note that 2n_d-rev(n_d)=1, regardless of the value of d. This means:
lim(2-rev(n_d)/n_d,d->infinity)=lim(1/n_d,d->infinity)=0
From this we see that for any real ε>0, there exists an integer n' such that |2-rev(n')/n'|<ε. In other words, while no integer can be exactly doubled by reversing its digits, we can find an integer that comes arbitrarily close to being doubled.
Can we find numbers that, when reversed, exactly reach other multiples--disregarding trivial cases such as palindromic numbers? It should be noted that in base 10, we can only consider multiples up to 9; multiplying by 10 or larger would increase the number of digits in the result. Indeed there are two multiples for which there exist numbers that reverse:
+----+--------+ | n |rev(n)/n| +----+--------+ +----+--------+ |2178| 4 | +----+--------+ |1089| 9 | +----+--------+
Note that the two working multiples are 9=10/1-1 and 4=10/2-1. We will return to this point later.
So far, we've considered numbers in base 10, but choosing a different base will affect the value of the number produced when reversing. For example, 37=25_16, but 52_16=82≠73. Can different bases yield numbers that exactly double when their digits are reversed?
The answer is yes. For bases 3≤b≤16, the following table shows the smallest numbers n_b that either exactly double when reversed or are off by 1/n_b. With the exception of 2, which adds one digit to a number when it doubles, each base not of the form b=3a+1, a∈N has at least one number that exactly doubles when its digits are reversed. Perhaps surprisingly, base 10 is actually in the minority!
+--+---------------+------------+ |b | n_b (n) |rev(n_b)/n_b| +--+---------------+------------+ +--+---------------+------------+ |3 | 1012_3 (32) | 2 | +--+---------------+------------+ |4 | 13_4 (7) | 2-1/7 | +--+---------------+------------+ |5 | 13_5 (8) | 2 | +--+---------------+------------+ |6 | 2134_6 (490) | 2 | +--+---------------+------------+ |7 | 25_7 (19) | 2-1/19 | +--+---------------+------------+ |8 | 25_8 (21) | 2 | +--+---------------+------------+ |9 | 3256_9 (2400) | 2 | +--+---------------+------------+ |10| 37 | 2-1/37 | +--+---------------+------------+ |11| 37_11 (40) | 2 | +--+---------------+------------+ |12|4378_12 (7436) | 2 | +--+---------------+------------+ |13| 49_13 (61) | 2-1/61 | +--+---------------+------------+ |14| 49_14 (65) | 2 | +--+---------------+------------+ |15|549A_15 (17920)| 2 | +--+---------------+------------+ |16| 5B_16 (91) | 2-1/91 | +--+---------------+------------+
There are some patterns evident in the above table, but they can be generalized by considering more cases. The following table shows the smallest numbers whose reverses are multiples of themselves from bases 3 to 16.
+------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ |rev(n_b)/n_b| n_3 | n_4 | n_5 | n_6 | n_7 | n_8 | n_9 | n | n_11 | n_12 | n_13 | n_14 | n_15 | n_16 | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 2 |1012_3 (32)| - | 13_5 (8) |2134_6 (490)| - | 25_8 (21) |3256_9 (2400)| - | 37_11 (40) |4378_12 (7436)| - | 49_14 (65) |549A_15 (17920)| - | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 3 | - |1023_4 (75)| - | - | 15_7 (12) |2156_8 (1134)| - | - | 14_11 (15) |3289_12 (5577)| - |1A735_14 (67275)| 3B_15 (56) |43BC_16 (17340)| +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 4 | - | - |1034_5 (144)| - | - | - | 17_9 (16) |2178| - | - | - | 2B_14 (39) |32BC_15 (10752)| - | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 5 | - | - | - |1045_6 (245)| - |1015_8 (525) | - | - | 19_11 (20) |219A_12 (3718)| 18_13 (21) | - | - | - | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 6 | - | - | - | - |1056_7 (384)| - | - | - | - | - | 1B_13 (24) | 21BC_14 (5850) | - | - | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 7 | - | - | - | - | - |1067_8 (567) | - | - | 118_11 (140) | - | - | - | 1D_15 (28) |21DE_16 (8670) | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 8 | - | - | - | - | - | - |1078_9 (800) | - | - | - | - | - | - | - | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 9 | - | - | - | - | - | - | - |1089| - | - | - |1419B_14 (49725)| - | - | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 10 | - | - | - | - | - | - | - | - |109A_11 (1440)| - | - | - | - | - | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 11 | - | - | - | - | - | - | - | - | - |10AB_12 (1859)| - | - |102B_15 (3416) | - | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 12 | - | - | - | - | - | - | - | - | - | - |10BC_13 (2352)| - | - | - | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 13 | - | - | - | - | - | - | - | - | - | - | - | 10CD_14 (2925) | - | - | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 14 | - | - | - | - | - | - | - | - | - | - | - | - |10DE_15 (3584) | - | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+ | 15 | - | - | - | - | - | - | - | - | - | - | - | - | - |10EF_16 (4335) | +------------+-----------+-----------+------------+------------+------------+-------------+-------------+----+--------------+--------------+--------------+----------------+---------------+---------------+
A few patterns are clear from this extended table. Given any base b, the smallest number n_b such that rev(n_b)/n_b=b-1 takes the form:
n_b=(b-1)(b+1)^2
In contrast, if b≡0 mod 3, the smallest n_b such that rev(n_b)/n_b=2 usually takes the form:
n_b=b/3(b-1)(b+1)^2
When b≡-1 mod 3, the form that doubles is even simpler:
n_b=((b+1)/3)(b-1)
b≡1 mod 3 has no number that exactly doubles when reversed, but the smallest n_b for which |2-rev(n_b)|=1/n_b is similar to the form that doubles when b≡-1 mod 3:
n_b=((b+2)/3)(b-1)+1
These numbers only fail to be the smallest when their digits are not setwise coprime. For example, the smallest n_11 such that rev(n_11)/n_11=3 should be 28_11 per the formula, but it is actually 14_11=28_11/2 because both digits are divisible by 2.
These forms are not coincidental, and they can be generalized. As an example, consider the following numbers for base b=15:
+------------------+--------------+-----------------+--------------+-----------------+ | rev(n_b)/n_b=2 |rev(n_b)/n_b=3| rev(n_b)/n_b=4 |rev(n_b)/n_b=7| rev(n_b)/n_b=14 | +------------------+--------------+-----------------+--------------+-----------------+ +------------------+--------------+-----------------+--------------+-----------------+ | 549A_15 (17920) | 3B_15 (56) | 32BC_15 (10752) | 1D_15 (28) | 10DE_15 (3584) | |n_b=5(b-1)(b+1)^2}| n_b=4(b-1) |n_b=3(b-1)(b+1)^2| n_b=2(b-1) |n_b=(b-1)(b+1)^2}| +------------------+--------------+-----------------+--------------+-----------------+
The numbers in the table above take the form (b-1) or (b-1)(b+1)^2. At first, they may appear to simply alternate between one form or the other. But when we consider the multiples reached by these numbers when they reverse, we see a stronger pattern:
rev(5(b-1)(b+1)^2)/(5(b-1)(b+1)^2)=2=15/5-1 rev(3(b-1)(b+1)^2)/(3(b-1)(b+1)^2)=4=15/3-1 rev((b-1)(b+1)^2)/((b-1)(b+1)^2)=14=15/1-1 rev(4(b-1))/(4(b-1))=3=16/4-1 rev(2(b-1))/(2(b-1))=7=16/2-1
The pattern obeys the following rules given a base b and an integer a>b/2. If a|b:
rev(a(b-1)(b+1)^2)=(b/a-1)(a(b-1)(b+1)^2)
If a|(b+1):
rev(a(b-1))=((b+1)/a-1)(a(b-1))
We conjecture this is true for all such a and b.
There are, however, other numbers in the chart that don't have an evident underlying pattern. Consider the following four values, which include base 17:
5101_8/1015_8=2625/525=5 811_11/118_11=980/140=7 B9141_14/1419B_14=447525/49725=9 EC51_17/15CE_17=72336/6576=11
The base of each number in this sequences increases by 3 and the multiple each number reaches increases by 2. Further, each number is divisible by b-1, and numbers with even bases are divisible by 3. Beyond these facts, whether these numbers posses a common closed form is unknown.
Further, there seem to be oddball cases where no direct multiples are present. The simplest example with b≤16 is b=13; 81_13/18_13=5, but neither b nor b+1 is a multiple of 5, and 18_13=21 is not a multiple of b-1. We conjecture other cases exist, and no closed form for these is known.
Existing research into this topic appears to be limited. Young (1992)^ created a rooted-tree method to find all n_b that satisfy rev(n_b)/n_b=k with a fixed b and k, which are referred to as (b,k)-reverse multiples. al-Tahan (2015)^^ focused on base 10 and developed general forms for all decimal k-reverse multiples. I am not aware of research that identifies patterns across bases. I would like to search for more patterns and ideally produce proofs for my findings herein.
^ Young, Anne Ludington. "k-Reverse Multiples." The Fibonacci Quarterly 30.2 (1992): 126-132.
^^ al-Tahan, Madeleine Ali. "(10,k)-Reversible Multiples." arXiv:1503.07848 [math.GM]. doi:10.48550/arXiv.1503.07848.
---
[Last updated: 2024-01-19]