8

Define, for all positive integer $n$ :

$$S_n=\sum_{1\leqslant i,j\leqslant n}\min(i,j)$$

A simple calculation leads to the following closed formula :

$$\forall n\in\mathbb{N}^\star,\,S_n=\frac{n(n+1)(2n+1)}6$$which is notoriously equal to $\displaystyle{T_n=\sum_{k=1}^nk^2}$.

My question : Is it possible to anticipate the relation $\forall n\in\mathbb{N}^\star,\,S_n=T_n$ without doing any computation ?

Blue
  • 83,939
Adren
  • 8,184
  • 1
    Consider stacking boxes into a pyramid, with each layer being a square one unit larger than the last, but they are all shoved against a corner instead of being centered. Now your first sum is counting the height of each column, while the second sum is the number of boxes at each layer. – Trebor Sep 18 '24 at 05:46

4 Answers4

5

Yes, this is expected.

Let's stack some cubes of $n$ layers with two sides at a corner of a room.

At the bottom layer, we have a square of size $n \times n$.

At the second bottom layer, we have a square of size $(n-1) \times (n-1)$.

For the case of $k$-th level from the top, we have a square of size $k \times k$.

stack of cubes

Source of picture

For small cases:

We have

$$\begin{bmatrix} 1 & 1 & 1 \\ 1 & 2 & 2 \\ 1 & 2 & 3\end{bmatrix} = \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1\end{bmatrix}+ \begin{bmatrix} 0 & 0 & 0 \\ 0 & 1 & 1 \\ 0 & 1 & 1\end{bmatrix}+ \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 1\end{bmatrix}$$

The matrix of the left contains $\min(i,j)$ where the terms on the right show the layers of cubes.

It is counting by columns vs counting by layers.

Siong Thye Goh
  • 153,832
3

Consider the following $n\times n$ grid

$$\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}$$

where the $(i,j)$-th entry is $\min\{i,j\}$.

Now strip off each layer (of $1$s and then $2$s and so on) and sum them separately. That will give $$1\times (2n-1) + 2\times (2n-3) + 3\times (2n-5) + \dots + n\times 1$$ which can be re-interpreted as $$(2n-1) + (2n-3) + (2n-3) + (2n-5) + (2n-5) + (2n-5) + \dots$$ and since the sum of the first $n$ odd integers is $n^2$, you have your proof.

Sayan Dutta
  • 10,345
  • 2
    I think what you're saying is$$\begin{align}\sum_{i=1}^{n}\sum_{j=1}^{n}\min\left{i,,j\right}&=\sum_{k=1}^{n}k\left(2n+1-2k\right)\&=\sum_{m=1}^{n}\left(n+1-m\right)\left(2m-1\right)\&=\sum_{l=1}^{n}l^{2}.\end{align}$$ – J.G. Sep 18 '24 at 07:19
  • @J.G. yes, but in a more visual way – Sayan Dutta Sep 19 '24 at 12:14
2

This answer generalizes the question.

Call the sum $S$ for the case asked. Consider a tuple $(a,b) \in \mathbb N^2$ where $1\le a,b\le n$. Consider some $r \in [1,n] \cap \mathbb N$. For how many tuples $(a,b)$ is $\min(a,b) = r$? You can construct exactly $(n-r+1)^2 - (n-r)^2$ such tuples$^{*}$. Thus the sum is just

$$\begin{align} S &= \sum_{r=1}^{n} r((n-r+1)^2 - (n-r)^2) \\ &= \sum_{r=1}^{n} r(n-r+1)^2 - \sum_{r=1}^{n} r(n-r)^2 \\ &= \sum_{r=1}^{n} r(n-r+1)^2 - \sum_{\color{red}{r=0}}^{n} r(n-r)^2\\ &= \sum_{r=1}^n (n-r+1)r^2 - \sum_{r=0}^n (n-r)r^2\tag{1.1}\\ &= \sum_{r=1}^n (n-r+1)r^2 - \sum_{\color{red}{r=1}}^n (n-r)r^2\\ &= \sum_{r=1}^n r^2 \end{align}$$

REMARKS:

$^{*}$: the most important aspect of the solution is counting the number of tuples where $\min(a,b)=r$ is obeyed. To count them first count all the tuples where $(a,b) \in \{r,r+1,r+2,\dots, n\}^2$ and then subtract all tuples where $(a,b) \in \{r+1,r+2,r+2, \dots, n\}^2$. This counts all tuples where $\min(a,b) \geq r$ and then subtracts all tuples where $\min(a,b)\geq r+1$.

$(1.1)$ uses the fact that $\sum_{r=a}^{n} f(r) = \sum_{r=a}^n f(n-r+a)$. This is called reversing the order of the sum.

I provide two bonuses;

Claim $1$: $S_1(k,n) = \underset{1\le x_1,x_2,x_3,\dots,x_k \le n}{\sum} \min(x_1,x_2,x_3,\dots, x_k) =\sum_{r=1}^n r^k$

Setting $k=2$ in this case yields the desired identity asked in the question.

Proof: Consider all $k$-tuples $\in \mathbb N^k$ where all their elements are in $[1,n]$. There are exactly $(n-r+1)^k - (n-k)^k$ such $k$-tuples which have their minimum element some fixed $r$. Since $r\in [1,n] \cap \mathbb N$ we have

$$\begin{align} S_1(k,n) &= \sum_{r=1}^n r((n-r+1)^k - (n-r)^k) \\ &= \sum_{r=1}^{n} (n-r+1)(r)^k - \sum_{r=1}^n (n-r)(r)^k \\ &= \boxed{\sum_{r=1}^n r^k} \end{align}$$

Claim $2$: $S_2(k,n) = \underset{1\le x_1,x_2,x_3,\dots,x_k \le n}{\sum} \max(x_1,x_2,x_3,\dots, x_k) =n^{k+1} - \sum_{r=1}^{n-1} r^k$

Proof: As usual, there are exactly $r^k - (r-1)^k$ $k$-tuples such that the tuple's maximal element is some $r\in[1,n]\cap \mathbb N$ where the $k$-tuples are $\in \mathbb N^k$ where each element $\in [1,n]$. Thus $$\begin{align} S_2(k,n) &= \sum_{r=1}^n r(r^k - (r-1)^k)\\ &= n^{k+1}+\sum_{r=1}^{n-1}r^{k+1} - \sum_{r=1}^{n-1}(r+1)r^k\\ &= \boxed{n^{k+1}-\sum_{r=1}^{n-1} r^k} \end{align}$$

Sahaj
  • 5,355
  • Although the answer looks long and it isn't a sleek visual proof, I still argue that the answer did not involve any "computations" which was requested by OP. I just used some re-arrangements of summations and elementary combinatorics. – Sahaj Sep 18 '24 at 12:17
1

For a fixed $k$, there are precisely $2(n-k+1) - 1$ tuples $(i,j) \in [n] \times [n]$ such that $\min(i,j) = k$. Thus, the sum can be expressed as

$$\sum_{k=1}^n k \times (2(n-k+1) - 1) = \sum_{k=1}^n (n-k+1) \times (2k - 1) $$

A number $2k-1$ is contributing to this sum $(n-k+1)$ times. We can visualize this as a stacked sequence of rows of decreasing length where row $1$ has $n$ repetitions of $1$, row $2$ has $n-1$ repetitions of $3$ and so on.

The result $S_n = T_n$ is apparent by instead summing this construction column-wise and recalling that the sum of the first $k$ odd numbers is $k^2$. The latter fact can be shown purely combinatorially.