Interesting properties of squares. Recently, I have been spending quite a bit of time with nothing more than a pencil and a stack of graph paper, and simply playing with numbers.
I noticed that if you square a string of n 1’s, you get a number whose digits count up to n, then count back up. (Which is easily understandable.)
If you sum these digits, you end up with $n^2$. (I’m nearly 100% sure someone has discovered this before me, it’s pretty simple)
I do not fully understand why this occurs, could someone help explain?
Here are a few examples:
$$1^2=1; 1=1; 1=1^2$$
$$11^2=121; 1+2+1=4; 4=2^2$$
$$111^2=12321; 1+2+3+2+1=9; 9=3^2$$
$$...$$
$$11111111^2=123456787654321; 1+2+3+4+5+6+7+8+7+6+5+4+3+2+1=64; 64=8^2;$$
$$...$$
 A: Let us more generally consider what happens when you compute $(1+x+x^2+\dots+x^{n-1})^2$ (in your case, $x=10$).  We will get an $x^k$ term for each pair $(i,j)$ of integers in $[0,n-1]$ such that $i+j=k$.  If $0\leq k\leq n-1$, then there are $k+1$ such pairs: $i$ can be anything from $0$ to $k$, and then $j$ must be $k-i$.  If $n-1\leq k\leq 2n-2$, then taking $k'=2n-2-k$, pairs $(i,j)$ which sum to $k$ are in bijection with pairs $(i',j')$ which sum to $k'$ by taking $i'=n-1-i$ and $j'=n-1-j$.  So the coefficient of $x^k$ is the same as the coefficient of $x^{k'}$, which is $k'+1=2n-1-k$. Concretely, this means we have $$(1+x+x^2+\dots+x^{n-1})^2=1+2x+3x^2+\dots+(n-1)x^{n-2}+nx^{n-1}+(n-1)x^n+\dots+x^{2n-2}.$$
For $x=10$, this gives exactly the decimal expansions you have seen (at least, as long as $n<10$ so the coefficients do not spill over into other digits).  Other integer values $x>1$ correspond to doing the same process in different bases.
Now to sum the digits of your squares, we can just take $x=1$ instead of $x=10$, so that each power of $10$ becomes $1$ and we are just adding their coefficients (i.e., the digits).  We thus find that the sum of the digits is $(1+1+1^2+\dots+1^{n-1})^2=n^2$.
A: Consider, for instance, $111\times111$. It is equal to $111+1110+11100$. Therefore:


*

*the units digit is $1$;

*the next digit is $1+1=2$;

*the next digit is $1+1+1=3$;

*the next digit is $1+1=2$;

*the leading digit is $1$.


So, you get $12321$.
Now if you sum $1+2+\cdots+(n-1)$ with itself twice and then you add $n$ to this sum, then you get$$2\times\frac{(n-1)n}2+n=n^2-n+n=n^2.$$
A: Unfortunately, your pattern only works for $1 \le n \le 9$.

For example, for $n=10$, we have
$$1111111111^2 = 1234567900987654321$$
but the sum of the digits is $82$, not $10^2$.

As a point of interest, I think the following is true, although I don't have a proof . . .

Conjecture: 

If $n = 9k^2$, for some positive integer $k$, and if $m$ is the $n$-digit number with digit representation 
$$
\underline{1}
\,\underline{1}
\,\underline{1}
\,\,...
\,\underline{1}
$$
then the sum of the digits of $m^2$ is a perfect square.
