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.
