When $N = 111\dots1 \times 11\dots1$, what is the sum of all digits of $N$? 
When $N = 111\dots1 \times 111\dots1$, what is the sum of all digits of $N$? Note that the number of ones in both numbers is $1989$. Generalize if possible.

Greetings, I was doing the above question but could not solve it. This problem is tricky. I haven't made any progress on this question. The answer key tells that the answer is $17901$.

Still here's what I've done so far (at least tried so far):
Note that $\underbrace{111\dots111}_{1989\ 1\text{'s}} = \frac19 (10^{1989} - 1)$
We get $N = 11\dots11 × \frac19(10^{1989} − 1)$
I noticed that $$\frac19 \times 111...1 \text{(1989 1's)} = 12345689...123456789$$ with $221$ blocks of $123456789$.
If somehow, we could reduce the expression in terms of $\frac19 \times 111...1$, we would be done.
This is it.
EDIT: As pointed out by Robert Israel in the comments, $$(\frac{10^n−1}{9})^2 = \frac{10^{2n} - 2\cdot 10^ + 1}{81}.$$ Now $\frac{1}{81}$ repeats $.012345679$. So it's reasonable there should be a pattern that depends on $n$ mod $9$ which was pointed out earlier in this post.

Any help would be appreciated. Please try to provide the solution in layman's terms and in the easiest way.
Very Thank You.

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.
