Sum of digits of $11\dots 11^2$ where $11\dots 11$ is a 1992 digit number with all digits $1$ [duplicate]

I think my method is essentially equivalent to Archaick's, but it might make it more clear how you can count without it being brute force per se. Note that the number we are squaring is $\frac{10^{1992}-1}{9}$, so we are counting the digits of $$ \left(\frac{10^{1992}-1}{9}\right)^2 = \frac{1}{81}(10^{3984} - 2\cdot 10^{1992} +1) $$ To write this out as an integer, note that $$ \frac{1}{81} = \frac{12,345,679}{999,999,999} \quad \text{ and thus} \quad \frac{2}{81} = \frac{24,691,358}{999,999,999} $$ This tells us the repeating 9-digit patterns in $\frac{10^{3984} }{81}$ and $\frac{2\cdot 10^{1992}}{81}$. To take the difference, note that the two leading terms are $1$'s in the $10^{3982}$ place and in the $10^{1990}$ place, respectively. The first subtraction then occurs at the latter digit, which corresponds to the digit $4$ in the expansion of $\frac{10^{3984} }{81}$, as $3982-3 = 3980 \equiv 1990 \mod 9$. The difference therefore has the repeating pattern unchanged from digits in the $10^{1991}$ place to the $10^{3982}$ place, and for lesser digits, the repeating pattern is now $$ 456,790,123-246,913,580 = 209,876,543 $$ This pattern repeats indefinitely, until the decimal point, at which point we add $1/81$ with the effect of rounding $...320.\overline{976543210}$ up to $...321$.

Note that there are $221$ nine-digit sequences in each pattern, in addition to the leading three digits and the trailing two digits. The sum of the digits is then $1+2+3+221(44) + 221(37) + 2 + 1 = 9 + 221\cdot 81 = 17910$.


This is not particularly pretty but I figured I'd share the complications which arise in using this method. If you multiply this out the way that most elementary students are taught to multiply numbers (at least in the US), you'll have a sum of the form $(11\ldots11)\sum_{i=1}^{1992}10^i$, lined up into $1991*2+1=3983$ columns. In the first column, there will be a single 1. In the second, there will be two, etc. Therefore the first nine digits will be $\ldots987654321$. The tenth digit will be a 0 and will be followed by a 2, instead of 1, owing to the 'carried' digit from when we reached the column which had 10 ones in it. More succinctly, the half of this expansion where the number of 1s in each column is increasing, will contribute $(11\ldots11)^2=\sum_{i=1}^{N} i(10)^{i-1}$ (where $N$ is the number of digits of the square) to the entire product. This pattern will continue until we get halfway through the total number of digits of the product. That is to say that every nine digits will cycle through $\ldots098765432\ldots$ It will only be nine because we 'skip' the ones, owing to the carried digits. Once we are precisely half way through the columns, the number of ones in each column will begin decreasing with every additional column. However, when we reach a column with $10^n+1$ 1s in it, there will no longer be any reason to skip it. However, when we get to a column which contains $10^n$ 1s in it, we will add $n$ to the next column, but only $n-1$ to the column after that. Hence, we will be skipping $8$s now. That is, after the halfway mark, we will see $12320$ (since $1992 \mod 9=3$) and then the digits will cycle through $\ldots123456790\ldots$. We are now ready to compute our grand total. The first 9 digits will contribute $1+2+3+4+5+6+7+8+9=45$. Since $1989/9= 221$, we will then have 220 cycles of $098765432$, each of which will contribute 44. We will also have $\ldots12320\ldots$ in the center which will contribute $8$ and then 221 cycles of$\ldots123456790\ldots$, each of which will contribute 37. $45+(220*44)+8+(221*37)=17910$. I have a hard time believing that there are more than a handful of sixth graders in the world capable of this sort of math.


Sum $=9n+((n \bmod 9)-9) (n \bmod 9)$ where $n=$ number of digits.

Check:

n = 1992;
9 n + (Mod[n, 9] -9) Mod[n, 9]
Total@IntegerDigits[FromDigits[ConstantArray[1, n]]^2]