987654321 / 123456789
I recently saw someone post [1] that 987654321/123456789 is very nearly 8, specifically 8.0000000729. I wondered whether there’s anything distinct about base 10 in this. For example, would the ratio of 54321six and 12345six be close to an integer? The ratio is 4.00268, which is pretty close to 4. What about a larger base? Let’s try base 16. The expression 0xFEDCBA987654321 / 0x123456789ABCDEF in Python returns 14. The exact ratio is not 14, but it’s as close to 14 as a standard floating point number can be. For a base b, let denom(b) to be the number formed by concatenating all the digits in ascending order and let num(b) be the number formed by concatenating all the digits in descending order. Then for b > 2 we have The following Python code demonstrates [2] that this is…