Why is $\frac{987654321}{123456789}$ almost exactly $8$? I just started typing some numbers in my calculator and accidentally realized that $\frac{123456789}{987654321}=1/8$ and vice versa $\frac{987654321}{123456789}=8.000000072900001$, so very close to $8$. 

Is this just a coincidence or is there a pattern behind this or another explanation? I tried it with smaller subsets of the numbers but I never got any similar pattern.
Let's define $d(b)=\sum^{b-1}_{k=1}k\,b^{k-1}$ and $u(b)=\sum^{b-1}_{k=1}(b-k)\,b^{k-1}$ (ours would be the special case $b=10$). Now from the well-known series $$\frac{1}{(1-x)^2}=1+2x+3x^2+4x^3+\cdots,$$ we have
$$d(b)\approx\frac{b^{b-2}}{\left(1-\frac{1}{b}\right)^2}$$
and $$u(b)+d(b)=b\,\frac{b^{b-1}-1}{b-1}\approx\frac{b^{b-1}}{1-\frac{1}{b}}.$$
So $$\frac{u(b)}{d(b)}\approx b\,\left(1-\frac{1}{b}\right)-1=b-2.$$
I won't make the $\approx$ more precise, it's not hard, but tedious. Here are some numerical values for that ratio for various bases:
10: 8.00000007290000
11: 9.00000000350494
12: 10.00000000014928
13: 11.00000000000571
14: 12.00000000000020
15: 13.00000000000001
16: 14.00000000000000
17: 15.00000000000000
18: 16.00000000000000
19: 17.00000000000000
20: 18.00000000000000
There does not seem to be an explanation that makes it easy to explain why $\frac{987654321}{123456789}$ is so close to $8$ other than a Mathematical coincidence.

However, since it is not exactly $8$, this does not count as a mathematical coincidence. Maybe the best way to rewrite it that shows why it is close to $8$ is:

$8\cdot123456789 + 9 = 987654321$



But the thing that is not hard to explain is the basic algebra that given:

$$\frac{123456789}{987654321} \approx \frac{1}{8}$$

Taking the inverse results in:

$$\frac{987654321}{123456789} \approx \frac{8}{1} (= 8)$$