Consider the infinite "multiplication table" array $M$ defined by $M_{i,j}=ij$
$M =
\left[\begin{array}{r}
1 & 2 & 3 & 4 & 5 \\
2 & 4 & 6 & 8 & 10 \\
3 & 6 & 9 & 12 & 15 & \cdots\\
4 & 8 & 12 & 16 & 20 \\
5 & 10 & 15 & 20 & 25 \\
&& \vdots &&& \ddots
\end{array}\right]$
Let $L(n) =
\{M_{i,j} : 1 \le i \le n \wedge j=n \} \cup
\{M_{i,j} : i=n \wedge 1 \le j \le n \}$
be sum of the the _| shaped region consisting of all elements of $M$ whose first or second index is $n$ and whose other index is less than or equal to $n$. For example, the elements of $L(4)$ are shown below.
$M =
\left[\begin{array}{r}
1 & 2 & 3 & \color{red}4 & 5 \\
2 & 4 & 6 & \color{red}8 & 10 \\
3 & 6 & 9 & \color{red}{12} & 15 & \cdots\\
\color{red}4 & \color{red}8 & \color{red}{12} & \color{red}{16} & 20 \\
5 & 10 & 15 & 20 & 25 \\
&& \vdots &&& \ddots
\end{array}\right]$
It turns out that $L(1)=1,\; L(2)=8,\; L(3)=27,\; L(4)=64,$ and $L(5)=125$.
We show that $L(n) = n^3$.
\begin{align}
L(n)
&= \sum_{i=1}^n M_{i,n} + \sum_{j=1}^n M_{n,j} - M_{n,n} \\
&= n\sum_{i=1}^n i + n\sum_{j=1}^n j - n^2 \\
&= n^2(n+1) - n^2 \\
&= n^3
\end{align}
Let $S(n)$ be the sum of the $n^2$ elements in the $n \times n$ subarray of elements in the upper-left corner of $M$.
For example, $S(3) = (1+2+3) + (2 + 4 + 6) + (3 + 6 + 9) = 36$
We will compute $ S(n)$ two ways.
\begin{align}
\sum_{i=1}^n \sum_{j=1}^n M_{i,j}
&= \sum_{i=1}^n \sum_{j=1}^n ij \\
&= \left(\sum_{i=1}^n i \right) \left(\sum_{j=1}^n j \right) \\
&=\left[\frac{n(n+1)}{2}\right]^2
\end{align}
Also,
\begin{align}
S(n) &= L(1) + L(2) + \cdots + L(n) \\
S(n) &= \sum_{i=1}^n i^3
\end{align}
So $\displaystyle \sum_{i=1}^n i^3 = \left[\frac{n(n+1)}{2}\right]^2$