When $N = 111\dots1 \times 11\dots1$, what is the sum of all digits of $N$?

From this question, we know that the sum of digits of the square of $S_n:=\sum_{k=0}^{n-1}10^k$ is equal to $81\cdot \left( \left\lfloor \frac{n}{9} \right\rfloor + \left\{\frac{n}{9}\right\}^2 \right)$.

Since $1989=9\cdot221$, we see that the sum of digits of your $N$ is equal to $9\cdot1989=17901$.


Let me try to fill in a little gap in the hint $4$ of the referred answer.

We would like to show that $S_{n+9}^2=10^9\cdot S_n^2+S_9\cdot S_{2n+9}$.

Expanding the sum in $S_{n+9}^2$, we see that, (here a $\sum$ along means summation over $10^{k+\ell}$, abbreviated).

$$\eqalign{S_{n+9}^2&=\sum_{k=0}^{n+8}\sum_{\ell=0}^{n+8}\\ &=\sum_{k=9}^{n+8}\sum_{\ell=0}^{n-1}+\sum_{k=0}^{8}\sum_{\ell=0}^{n-1}+\sum_{k=0}^{n+8}\sum_{\ell=n}^{n+8}\\ &=10^9\cdot S_n^2+\sum_{k=0}^{8}\sum_{\ell=0}^{n-1}+\sum_{k=0}^{n-1}\sum_{\ell=n}^{n+8}+\sum_{k=n}^{n+8}\sum_{\ell=n}^{n+8}\\ &=10^9\cdot S_n^2+\sum_{k=0}^{8}\sum_{\ell=0}^{n-1}+\sum_{k=0}^{8}\sum_{\ell=n}^{2n-1}+\sum_{k=0}^{8}\sum_{\ell=2n}^{2n+8}\\ &=10^9\cdot S_n^2+\sum_{k=0}^8\sum_{\ell=0}^{2n+8}\\ &=10^9\cdot S_n^2+S_9\cdot S_{2n+9}. }$$


Hope this helps.