TITLE: Why is this the trick to calculate $m\, 9$s $\times n\, 9$s?
QUESTION [6 upvotes]: Here is what observed for the results of $m\, 9$s $\times n\, 9$s ($m \leq n$)
$9\times9=81, 9\times99=891, 9\times999=8991$
$99\times99=9801, 99\times 999=98901, 99\times9999=989901$
$999\times999=998001,999\times 9999=9989001, 999\times99999=99899001$
Summarize the following trick  to get the result fast:
For example to get $999\times99999 =99899001$

Write down $n\,$$9$s $(n=5)$ first : $\to 99999$
Replace the $m\,$th $(m=3) 9\,$s with $8: \to 99899$
Attach $ (m-1)\, 0$s $(m-1=2): \to 99899 00$
Attach last  $1: \to  99899 00 1$

My question is how to prove this is true with algebra?

REPLY [3 votes]: This is an answer to a question that includes your question.
Just as you can cast out $9$s, you can also cast out $99$s, $999$s, etc.
For example.

$98765 \equiv 9+8+7+6+5 \equiv 35 \equiv 3+5 \equiv 8 \pmod 9$

$98765 \equiv 09+87+65 \equiv 161 \equiv 01 + 61 \equiv 62\pmod{99}$

$98765 \equiv 098 + 765 \equiv 863 \pmod{999}$



To multiply a single digit number, $n$ times $9$:

The first digit is $n-1$ and the second digit is $9 - (n-1)$.
For example, $3 \times 9 = 27 \qquad (2+7=9)$
For example, $9 \times 9 = 81 \qquad (8+1=9)$


To multiply a two-digit digit number, $ab$ times $99$:

The first two digits are $ab-1$ and the second two digits are $99 - (ab-1)$.
For example, $32 \times 99 = 3168 \qquad (31+68=99)$
For example, $40 \times 99 = 3960 \qquad (39+60=99)$
For example, $99 \times 99 = 9801 \qquad (98+01=99)$


To multiply a three-digit digit number, $abc$ times $999$:

The first three digits are $abc-1$ and the second three digits is $999 - (abc-1)$.
For example, $342 \times 999 = 341658 \qquad (341+658=999)$
For example, $44 \times 999 = 043956  \qquad (043+956=999)$
For example, $999 \times 999 = 998001 \qquad (998+001=999)$


One more example:

$123456 \times 999999 = 123455876544$