121. (Rule XXI). Determine the number of layers in a triangular heap.

## Problem of Paramadisvara.

From the commentary on the treatise of Aryabhata.
121. This task represents the summation of so-called triangular numbers of the form: $\frac{n(n+1)}{2}$.

Let's write the natural series: $1,2,3,4,5,6,7,8,9 \ldots$

The series of triangular numbers will be:

$$
1,3,6,10,15,21,28,36,45,55 \ldots
$$

It is clear that the sum of any two consecutive numbers always represents a perfect square. Denoting any triangular number by the symbol $T$, we will have:

$$
\begin{aligned}
& T_{n}+T_{n-1}=n^{2} \\
& T_{n-1}+T_{n-2}=(n-1)^{2} \\
& \dot{-} \dot{\bullet} \cdot \bullet \cdot \cdot ・ \\
& T_{3}+T_{2}=3^{2} \\
& T_{2}+T_{1}=2^{2}
\end{aligned}
$$

Let's denote the sum $T_{1}+T_{2}+T_{3}+\ldots+T_{n}$ by $\Sigma_{n}$. Then the addition of the previous equations will give:

$$
\begin{gathered}
T_{n}+2\left(T_{n-1}+T_{n-2}+\ldots+T_{2}\right)+T_{1}= \\
n^{2}+(n-1)^{2}+\ldots+3^{2}+2^{2}
\end{gathered}
$$

or

$$
\Sigma_{n}+\Sigma_{n}-\left(T_{1}+T_{n}\right)=S_{n}-1
$$

where $S_{n}$ is the sum of the squares of natural numbers,

$$
2 \Sigma_{n}=S_{n}-1+1+T_{n}=\frac{n(n+1)(2 n+1)}{6}+\frac{n(n+1)}{2}
$$

$\left(T_{1}=1\right)$ or

$$
\begin{gathered}
2 \Sigma_{n}=\frac{n(n+1)(2 n+1)+3 n(n+1)}{6} \\
2 \Sigma_{n}=\frac{n(n+1)(2 n+4)}{6} \\
\Sigma_{n}=\frac{n(n+1)(n+2)}{6}
\end{gathered}
$$

For example,

$$
\Sigma_{10}=\frac{10 \cdot 11 \cdot 12}{6}=220
$$

Paramadisvara, an Indian mathematician, of whom only that he commented on the work of Aryabhata is known.