# Why is $\frac{987654321}{123456789} = 8.0000000729?!$

Many years ago, I noticed that $987654321/123456789 = 8.0000000729\ldots$.

I sent it in to Martin Gardner at Scientific American and he published it in his column!!!

My life has gone downhill since then:)

My questions are:

• Why is this so?

• What happens beyond the "$729$"?

• What happens in bases other than $10$?

• 8.000000072900000663390006036849054935326399911470239194379176... Commented May 19, 2013 at 7:10
• I don't see it, why is this number interesting? Commented May 19, 2013 at 9:43
• 8.0000000729000006633900060368490549353263999114702391943791766688505076865396199475105415223459278533479434654662855357431983752631052148942574555377428453934598930804850270324137459949650885541823058430589831718367468637143964598010077841891708361214546087052369392176561468806709366141055231883602610140783752281132145758302526400552990245032211229793122191117411939168448646432882682539232411107014941073835963771907270324356159951641055559933605595395810918101879354727102128016629364951327221057077711619407175736605299203108222748284827009391925785466524647745374294482906079794445326129452467 Commented May 19, 2013 at 10:29
• Unrelated, but ever notice that Sqrt(9.87654321) approximates pi? The number system is full of this kind of stuff. Commented May 19, 2013 at 11:44
• @cobaltduck: It is a terrible approximation given how many digits you're putting in. It has more than $10$ times the error of $\sqrt{9.87}$ Commented May 19, 2013 at 18:28

In base $$n$$ the numerator is $$p = n^{n-1} - \frac{n^{n-1}-1}{(n-1)^2}$$ and the denominator is $$q = \frac{n(n^{n-1}-1)}{(n-1)^2}-1.$$

Note that $$p = (n-2)q + n-1$$ and for the quotient we get

\begin{align} \frac{p}{q} &= n-2 + \frac{(n-1)^3}{n^n} \frac{1}{1 - \frac{n^2-n+1}{n^n}} \\ &= n-2 + \frac{(n-1)^3}{n^n} \sum_{k=0}^{\infty} \left(\frac{n^2-n+1}{n^n}\right)^k. \end{align}

Indeed for $$n=10$$ this is

$$\frac{987654321}{123456789} = 8 + \frac{729}{10^{10}}\sum_{k=0}^{\infty}\left(\frac{91}{10^{10}}\right)^k$$

• so methodical. Neat. Commented May 19, 2013 at 13:52
• I almost don't want to change the upvote from being "123." Commented Jun 2, 2020 at 23:51

$$729=9^3$$ $$66339=9^3\cdot 91$$ $$6036849=9^3\cdot 91^2$$ $$...$$ $$987654321/123456789=8+9^3\cdot 10^{-10}\cdot\displaystyle\sum_{n=0}^{\infty}(91\cdot 10^{-10})^n$$

• @FedericaMaggioni Please tell me you didn't just "find" that...! Commented May 19, 2013 at 7:40
• Could you add a bit more detail? Commented May 19, 2013 at 8:08
• Is it just me who is too stupid to understand what the pattern is?
– P.K.
Commented May 20, 2013 at 10:11
• @ΠάρτηΚοχλί look at Double AA's expansion in the comments above.. Commented May 20, 2013 at 10:26
– P.K.
Commented May 20, 2013 at 11:27

Let $$S_n(a)=1 +2a+\ldots +na^{n-1}=\frac{na^{n+1}-(n+1)a^n+1}{(a-1)^2},$$ $$T_n(a)=a^{n-1}+2a^{n-2}+\ldots +n=a^{n-1}S_n(a^{-1}).$$

Then $$\frac{S_n(a)}{T_n(a)}=\frac{na^{n+1}-(n+1)a^n+1}{a^{n+1}-(n+1)a+n}.$$ For $a=10,n=9$ we have $$\frac{S_n(a)}{T_n(a)}\approx\frac{8\cdot 10^{10}+1}{10^{10}}.$$

${987654321\,/\,123456789}\approx 8.00000007290000066339$

${{87654321}_9\,/\,{12345678}_9}\approx {7.000000628000056238}_9$

${{7654321}_8\,/\,{1234567}_8}\approx {6.0000052700046137}_8$

${{654321}_7\,/\,{123456}_7}\approx {5.00004260036036}_7$

${{\mathrm{fedcba987654321}}_{16}\,/\,{\mathrm{123456789abcdef}}_{16}}\approx {\mathrm{e.0000000000000d2f00000000000c693f}}_{16}$

• And what do these numbers show?? Commented May 21, 2013 at 19:04
• They show empirically that the behavior seen in base 10 is present for all bases. Commented May 21, 2013 at 20:13
• And what behavior is that? I asked in a comment to the question what's so interesting about this, no one has answered. Commented Jun 13, 2013 at 8:59
• The behavior is that the result is extremely close to the base minus two. Like a joke, if it has to be explained to you, it won't be funny. If you weren't intrigued by this when you first saw it, then you probably never will be. Commented Jun 13, 2013 at 15:00
• No, they show empirically that the behavior seen in base 10 is present for bases 9, 8, 7 and 16.
– jwg
Commented Jun 28, 2017 at 10:09

$98765432 / 12345679 = 8$, exactly. You can see how the pattern works by multiplying out $12345679 * 8$ starting at either end.

This explains why your fraction is close to an integer. If you think the $729$ is interesting (I don't), it can be explained by some of the other answers here.

## Edit:

What can we say about the fact that $12345679 * 8 = 98765432$? I have been aware of this 'factlet' for about 20 years, and remember it being used to 'demonstrate' calculators (which often had 8 digit displays back in the day).

I just recently realised that:

$$\frac{1}{81} = \left(\frac{1}{9}\right)^2 = \left(\sum_{k=1}^{\infty}\frac{1}{10^k}\right)^2 = \sum_{k=1}^{\infty} \sum_{m=1}^{k-1} \frac{1}{10^m} \frac{1}{10^{k-m}} = \sum_{k=1}^{\infty} \frac{k-1}{10^k}$$

In other words, while $\frac{1}{9} = 0.1111111\ldots$ $$\frac{1}{81} = 0.01 + 0.002 + 0.0003 + 0.0004 + 0.00005 \ldots$$

It is pretty easy to see that this infinite sum is going to converge to something starting $0.012345\ldots$. If you keep on adding, or work out $\frac{1}{81}$ by division, you get $$0.012345679012345679012345679\ldots$$ When you get to the point where you add $\frac{10}{10^{11}}$, the first carry happens, which leads to the 9 where you might expect an 8. After that every addition carries and the decimal expansion repeats every 9 digits (not every ten - because the amount we carry keeps on getting bigger and bigger).

Now, $\frac{8}{81} = \frac{9}{81} - \frac{1}{81}$, or $$\frac{8}{81} = 0.11111111\ldots - 0.012345679012345\ldots$$ Think of each '1' digit in $0.111\ldots$ as being a '10' in the next column. This means that we can work out $\frac{8}{81}$ as the "10's complement" of $\frac{1}{81}$, since we are subtracting a digit between $1$ and $9$ from $10$, to get another single digit which appears in the same place. So $\frac{8}{81}$ starts $0.098765\ldots$. The only break in the pattern is when you get to the digit '0' - subtracting 0 from 10 leaves you with 10, or a '1' in the next digit on the left, changing the 1 to a 2.

So $$\frac{8}{81} = 0.098765432098765432098765\ldots$$

and therefore $$0.0123456790123456790\ldots * 8 = 0.0987654320987654320\ldots$$ and clearly this gets you that $$12345679 * 8 = 98765432$$

• A bit late but note \times ($\times$) instead of *. Commented Apr 4, 2018 at 18:01

I think @BorisNovikov's answer is the best here, but I had to do some work to understand it; this is my attempt at clarifying his answer, hopefully this can help others too:

In the following, we adopt the notation $$123456789 = [ 1, 2, ..., B-1 ]_B$$ in base $$B=10$$.

Boris introduced the following sum: $$S_d(B) = [d, d-1, ..., 1]_B = 1 + 2B + ... + dB^{d-1} = \sum_{k=1}^d kB^{k-1} = \frac{dB^{d+1} - (d+1)B^d + 1}{(B-1)^2}$$ where $$d$$ is the number of digits, $$B$$ the base, and the final formula is obtained by derivation of the usual geometric sum.

From there, it is easy to see that: $$[1, 2, ..., d]_B = d + (d-1)B + ... + 1B^{d-1} = B^{d-1} S_d(1/B)$$ and putting both results together, we have: $$\frac{ [B-1, B-2, ..., 1]_B }{ [1, 2, ..., B-1]_B } = \frac{ S_{B-1}(B) }{ B^{B-2} S_{B-1}(1/B) } = \frac{1 + (B-2)B^B}{B^B - B(B-1) - 1}$$

Clearly both the numerator and denominator are dominated by the terms in $$B^B$$, so this fraction is equivalent to $$B-2$$ as $$B$$ tends to infinity, and we can see that the exact value is very close already for $$B=10$$ (see also @Mark Adler's post for other examples). Beautiful, isn't it? :)

I think one should also think about how this is related to 9 being before 10. Notice the two following striking facts:

$12345679*8=98765432$ and $12345679*9=111111111$

• See @jwg's answer. Commented Jan 1, 2019 at 14:07

An identity:
$$[B-1,B-2,...,1]_B - 1 =$$ $$=(B-2) ([1,2,...,B-1]_B+1)$$
A way to show this general identity goes as follow (we shall use base B and exactly B ciphers):

1. $$[0,B-1,B-2,...,2,1]+[0,1,2,...,B-2,B-1]=[1,1,...1,1,0]$$
2. $$[1,1,...,1,0]+[0,1,2,...,B-1]=[1,2,...,B-1,B-1]$$
So that:
$$[0,B-1,B-2,...,1]+2[0,1,2,...,B-1]=[1,2,...,B-1,0]+B-1=B[0,1,2,...,B-1]+B-1$$
Then in terms of B-1 ciphers numbers: $$[B-1,B-2,...,1]=(B-2)[1,2,...,B-1]+B-1$$
and: $$[B-1,B-2,...,1]-1=(B-2)[1,2,...,B-1]+B-2=$$ $$=(B-2)([1,2,...,B-1]+1)$$ So that the division proposed to Martin Gardner, by you, was very close to $$\frac{[B-1,B-2,...,1]-1}{[1,2,...,B-1]+1}=B-2$$ for B = 10. In fact, posing $$N=[0,B-1,...,1]$$ and $$D=[0,1,...,B-1]$$, we get: $$N/D-(B-2) = N/D - (N-1)/(D+1)=$$ $$=[N(D+1)-(N-1)D]/[D(D-1)]=(2D+N)/[D(D-1)]$$ where the numerator has B ciphers and the denominator 2(B-1) ciphers, and the quotient will be a number with $$B-3$$ null ciphers after the decimal separator sign.