Rectangles in a $n \times n$ grid and the sum of the first $n$ cubes: a geometric connection?
So it would take some effort to create the figure, but here is the math.
Let $N_k=\{i| 1\leq i \leq k\}$.
Consider an $(n+1)$x$(n+1)$ grid of points $\{(i,j)| \{i,j\}\subset N_{n+1}\}$ . The number of rectangles with vertices on those points is $\sum_{i=1}^n i^3$. If we consider the upper left subgrid of $n$x$n$ points, there are $\sum_{i=1}^{n-1} i^3$ rectangles within the upper left $n$x$n$ subgrid.
Subtracting, we find that there are exactly $n^3$ rectangles with a vertex on either 1) the right side of the $(n+1)$x$(n+1)$ grid or 2) the bottom of the $(n+1)$x$(n+1)$ grid. Call this set of rectangles $S$. We will group these $n^3$ rectangles into two disjoint sets: set $R$ - the rectangles with a vertex on the right side of the $(n+1)$x$(n+1)$ grid, and set $B$ - the rectangles with a vertex on the bottom of the $(n+1)$x$(n+1)$ grid that do not have a vertex on the right side of the grid.
$$S=R\cup B.$$
SET R
We can further divide set $R$ into $n$ disjoint subsets:
- subset $R_1$ the rectangles whose upper right vertex is $(n+1,n+1)$,
- subset $R_2$ the rectangles whose upper right vertex is $(n+1,n)$,
- ...
- subset $R_{n-1}$ the rectangles whose upper right vertex is $(n+1,3)$, and
- subset $R_n$ the rectangles whose upper right vertex is $(n+1,2)$.
The cardinality of $R_i$ is $n\cdot(n-i+1)$ where $1\leq i\leq n$.
Consider the sets $$C= \{(i,j,k) | \{i,j,k\}\subset N_n\},$$ $$C_R= \{(i,j,k) | \{i,j,k\}\subset N_n, i\leq j\},\mathrm{\ and}$$ $$C_B= \{(i,j,k) | \{i,j,k\}\subset N_n, i> j\}.$$
Note that $C$ is the disjoint union of $C_R$ and $C_B$.
Also notice that the intersection of $C_R$ and the set of points with x-coordinate is 1 has exactly $n^2$ points which happens to be the cardinality of $R_1$. The intersection of $C_R$ and the set of points with x-coordinate is 2 has exactly $n\cdot(n-1)$ points which happens to be the cardinality of $R_2$. Continuing in this fashion, we can see that there is a 1-1 correspondence between the rectangles in $R$ and the points in $C_R$. $$|R|=|C_R|.$$
SET B
We can divide set $B$ into $n-1$ disjoint subsets:
- subset $B_1$ the rectangles whose lower right vertex is $(n,1)$,
- subset $B_2$ the rectangles whose upper right vertex is $(n-1,1)$,
- ...
- subset $B_{n-2}$ the rectangles whose upper right vertex is $(3,1)$, and
- subset $B_{n-1}$ the rectangles whose upper right vertex is $(2,1)$.
The cardinality of $B_i$ is $n\cdot(n-i)$ where $1\leq i\leq n-1$.
Notice that the intersection of $C_B$ and the set of points with x-coordinate is $n$ has exactly $n\cdot (n-1)$ points which happens to be the cardinality of $B_1$. The intersection of $C_B$ and the set of points with x-coordinate is $(n-1)$ has exactly $n\cdot(n-2)$ points which happens to be the cardinality of $B_2$. Continuing in this fashion, we can see that there is a 1-1 correspondence between the rectangles in $B$ and the points in $C_B$. $$|B|=|C_B|.$$
We have shown that there is a 1-1 correspondence between the set of rectangles with a vertex either on the right side or the bottom of the $(n+1)$x$(n+1)$ grid of points and the points in an $n$x$n$x$n$ cube of points.
Induction could now be used to prove that the number of rectangles with vertices on a $(n+1)$x$(n+1)$ grid of points is $\sum_{i=1}^{n} i^3$.
Drawing all of this is possible but cumbersome.