# Finding sum of digits of a number in an olympiad question.

The question is question no $$6$$ from 2016 IWYMIC olympiad individual round (It can be found here.)

Rephrased in my words , in says :

Let $$A =\,\underbrace{ 6666...66666} _{2016 \, times}\,\,$$ and $$\,\,B =\,\underbrace{ 99999...99999} _{2016 \, times}$$

Let $$N = A\times B.$$ Find the sum of digits of $$N$$.

My Approach :

Using simple observation , we can see that :

$$6\times 9 = 54 \quad \quad \rightarrow S(N) = 9$$ $$66\times 99 = 6534 \quad \quad \rightarrow S(N) = 18$$ $$666\times 999 = 665334 \quad \quad \rightarrow S(N) = 27$$ Similarly we can conclude that:

$$\,\underbrace{ 6666...66666} _{2016 \, times}\,\, \times\,\,\,\underbrace{ 99999...99999} _{2016 \, times}\quad \quad \rightarrow S(N) = 2016\times 9 = 18144$$

Which is indeed the correct answer. But how can we mathematically prove this is always correct ?

My Take :

$$\underbrace{ 6666...66666} _{2016 \, times} = 6\, (\underbrace{ 1111...11111} _{2016 \, times})$$

And

$$\underbrace{ 9999...99999} _{2016 \, times} = 9\, (\underbrace{ 1111...11111} _{2016 \, times})$$

Therefore

$$N = 54 \,\,(\underbrace{ 1111...11111} _{2016 \, times})^2$$

And then Find A pattern in $$(\underbrace{ 1111...11111} _{2016 \, times})^2$$, Although the obvious pattern is only for small values and I lost my way quickly.

Can anyone suggest me a hint to prove this?

Suggestion: Rather than factoring out the $$9$$, note that $$999\cdots99 = 10^n-1$$. This makes it not too difficult to show that $$666\cdots 66\times 999\cdots99 = 666\cdots 665333\cdots 334$$ and summing the digits here is easy.