Combinatorial proof of $\sum_{1\le i\le n,\ 1\le j\le n}\min(i,j)=\sum_{i=1}^ni^2=\frac{n(n+1)(2n+1)}6$

Look at an $n\times n$ array whose entry in row $i$ and column $j$ is $\min\{i,j\}$:

$$\begin{array}{ccc} 1&1&1&1&\ldots&1\\ 1&2&2&2&\ldots&2\\ 1&2&3&3&\ldots&3\\ 1&2&3&4&\ldots&4\\ \vdots&\vdots&\vdots&\vdots&\ddots&\vdots\\ 1&2&3&4&\ldots&n \end{array}$$

The entries in the first column and top row are $1$. If you strip those off, the entries in the first column and top row of what remains are $2$. If you strip those off, the entries in the first column and top row of what remains are $3$, and so on.

Now think of this as representing a top view of three-dimensional object made of $1\times1\times 1$ blocks in which the number in a cell represents the height of the object at that point; the object is a sort of stepped pyramid that reaches a height of $n$ in the lower righthand corner. The bottom layer contains $n^2$ blocks. The second layer contains $(n-1)^2$. And in general the $k$-th layer contains $(n+1-k)^2$ blocks, so the total number of blocks (and hence the sum of the entries in the array) is

$$\sum_{k=1}^n(n+1-k)^2=\sum_{k=1}^nk^2\;.$$