Why does this pattern work: $1 \cdot{1} = 1, 11 \cdot{11} = 121, 111 \cdot{111} = 12321\ldots$

Just do the maths:

        1 1 1 1 1
      x 1 1 1 1 1
        ---------
        1 1 1 1 1
      1 1 1 1 1
    1 1 1 1 1
  1 1 1 1 1
1 1 1 1 1
-----------------
1 2 3 4 5 4 3 2 1

Of course the pattern only goes up to nine $1$'s, because after that you get eight hundred and ninety-ten in the billions column...


Since OP is asking for an algebraic explanation, I will try a different approach, possibly trickier than the other answer which is elegant but not formal.

We consider the polynomial $(1+x+x^2+\dots +x^n)^2$: by expanding the square we get

$$\begin{array}{|c|c|c|c|c|c|c|} \hline 1 & x & x^2 &\cdots& x^{n-1}& x^n\\ \hline x & x^2 & x^3 &\cdots& x^{n}& x^{n+1}\\ \hline x^2 & x^3 & x^4 &\cdots& x^{n+1}& x^{n+2}\\ \hline \vdots & \vdots & \vdots &\vdots& \vdots& \vdots\\ \hline x^{n-1} & x^{n} & x^{n+1} &\cdots& x^{2n-2}& x^{2n-1}\\ \hline x^n & x^{n+1} & x^{n+2} &\cdots& x^{2n-1}& x^{2n}\\ \hline \end{array}$$ that is, for $n\geq 0$, and for $0\leq j\leq 2n$,
$$\begin{align} (1+x+x^2+\dots +x^n)^2&=\sum_{j=0}^{n}\sum_{k=0}^{j} x^k\cdot x^{j-k} +\sum_{j=n+1}^{2n}\sum_{k=j-n}^{n} x^k\cdot x^{j-k}\\ &= \sum_{j=0}^{n}x^j\sum_{k=0}^{j} 1 +\sum_{j=n+1}^{2n}x^j\sum_{k=j-n}^{n} 1\\ &=\sum_{j=0}^{n}(j+1)x^j +\sum_{j=n+1}^{2n}(2n-j+1)x^j. \end{align}$$ In our case, we take $x=10$. The pattern works as soon as $j+1\leq 9$ for $j=0,\dots,n$ AND $2n-j+1\leq 9$ for $j=n+1,\dots,2n$ where $9$ is the largest decimal digit, that is for $n\leq 8$.

For $n=8$ and $x=10$ we have that $$(1+x+x^2+\dots +x^n)^2=111111111^2=12345678987654321$$ whereas for $n=9$ we get $$(1+x+x^2+\dots +x^n)^2=1111111111^2=1234567900987654321.$$


Other answers have already provided some intuition behind the pattern. Here is some terminology:

  • The numbers being squared, e.g. $111111$, are called repunits.

  • The resulting products are called Demlo numbers: $\,1, 121, 12321, 1234321,\, \dots$


Repunits can be written as sums of powers of $10$, and from that perspective, base-$10$ repunits are finite geometric series. For example: \begin{align} 111111 &= 1 + 10 + 100 + 1000 + 10000 + 100000\\ 111111&=1 + 10 + 10^2 + 10^3 + 10^4 + 10^5\\\\ 111111&=\displaystyle\frac{10^6-1}{10-1}\\\\ 111111&=\displaystyle\frac{10^6-1}{9} \end{align}

The last two lines above use the formula for the sum of a finite geometric series.

Squaring gives:

\begin{align} 111111^2 &= \left(\displaystyle\frac{10^6-1}{9}\right)^2\\ 111111^2 &= \displaystyle\frac{10^{12} - 2\cdot 10^6 +1}{81} \end{align}

In general:

$$\left(\,\underbrace{\,1111\,\dots\,1111\,}_{ n \text{ ones} } \,\right)^2 \, = \,\, \boxed{\displaystyle\frac{10^{2n} - 2\cdot 10^n +1}{81}\,}$$


Demlo numbers are sequence A002477 in the OEIS.