# Why is $111111111 \times 111111111 = 12345678987654321$

I was looking around on the internet until I stumbled upon this equation.

$$111111111\times111111111 = 12345678987654321$$ How does this actually work? It is quite amazing how the number ascend and then descend by ones.

• It is just a coincidence. You can yourself multiply out the numbers on pen and paper to see the reason Feb 16, 2018 at 2:07
• This looks like a trivial application of the Central Limit Theorem. Feb 16, 2018 at 3:43

Just multiply it out with the grade school pen-and-paper algorithm:

111111111 x 111111111
---------------------
111111111
111111111
111111111
111111111
111111111
111111111
111111111
111111111
111111111
------------------
12345678987654321


Each digit of the result comes from summing the digits in one column -- that is, counting how many ones there are. Since this is at most 9, there are no carries between columns.

• +1 - nice picture! To the OP, note that we can use this same picture to cook up versions of this in arbitrary bases. For example, in base $5$ we'll want the end result to be "$1234321_5$"; thinking about the picture above, this will happen when we square "$1111_5$." Feb 16, 2018 at 2:13

If you write one of the $111111111$ values up the side and the other across the top of a table, and multiply each digit selection individually, you get a table of $1$s. But the actual value behind those $1$s is a power of ten, so you collect like powers of ten as shown:

$$\left(\sum_{k=0}^n 10^k\right)^2 = \sum_{i=0}^n \sum_{j=0}^n 10^{i+j}$$ There are $k+1$ occurrences of $10^k$, namely $(i,j)=(0,k),(1,k-1),\ldots, (k,0)$, if $k \le n$, and $2n+1-k$, namely $(i,j) = (k-n,n),(k-n+1,n-1),\ldots,(n,k-n)$, if $n < k \le 2n$. If $n \le 8$ this means the decimal representation of $(1\ldots1)\times(1\ldots1)$ is $12 \ldots n (n+1) n \ldots 21$.