Why is $\frac{987654321}{123456789}$ almost exactly $8$? [duplicate]

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


Start with $\dfrac 1{9^2}=\dfrac 1{81}=0.012345679\underline{012345679}\;$ (this is well known see for example this thread) then $\;1-\dfrac 1{81}=\dfrac {80}{81}=0.987654320\underline{987654320}\;$ and conclude that : $$\dfrac {0.\underline{123456790}}{0.\underline{987654320}}=\dfrac {10}{81}\dfrac {81}{80}=\dfrac 18$$


Following Raymond Manzoni´s explanation, we can extend to:

$\dfrac {998877665544332211}{112233445566778899}=8,90000000000007000 $

$\dfrac {999888777666555444333222111}{111222333444555666777888999}=8,99000000000005000 $

$\dfrac {999988887777666655554444333322221111}{111122223333444455556666777788889999}=8,99900000000003000 $

....