Figure 1. Pyramidal numbers

The following note provides some exceedingly elementary mathematics, primarily for bālabodhana. Sometime back we heard a talk by a famous contemporary mathematician (M. Bhargava) in which he described how as a kid he discovered for himself the formula for pyramidal numbers (i.e. defined by the number of spheres packed in pyramids with a square base; Figure 1). It reminded us of a parallel experience in our childhood, and also of the difference between an ordinary person and a mathematician. In those long past days, we found ourselves in the company of a clansman who had a much lower sense of purpose than us in our youth (it seems to have inverted in adulthood). Hence, he kept himself busy by leafing through books of “puzzles” or playing video games. He showed us one such “puzzle” which was puzzling him. It showed something like Figure 1 and asked the reader to find the total number of balls in the pile if a base-edge had 15 balls. We asked him why that was a big deal — after all, it was just a lot of squaring and addition and suggested that we get started with a paper and pencil. He responded that he too had realized the same but had divined that what the questioner wanted was a formula into which we could plug in a base-edge with any number of balls and get the answer. We tried to figure out that formula but failed; thus, we sorted with the mere mortals rather than the great intellectuals.

Nevertheless, our effort was not entirely a waste. In the process of attempting to crack the formula, we discovered for ourselves an isomorphism: The count of the balls in the pyramid is the same as the total number of squares that can be counted in a square grid (Figure 2). In this mapping, the single ball on the top is equivalent to the biggest or the bounding square. The base layer of the pyramid corresponds to the individual squares of the grid. All other layers map onto interstitial squares — in Figure 2 we show how those are defined by pink shading and cross-hatching of one example of them. In this mapping, the entire pyramid is mapped into the interior of the apical ball, which is now represented as a sphere. Thus, the number of balls packed into a pyramid and the number of squares in a square grid are merely 3D and 2D representations of the same number, i.e. the sum of squares

Figure 2. The total number of squares formed by contact in a square grid.

We got our answer to this a couple of years later when we started reading the Āryabhaṭīyam of Āryabhaṭa, one of the greatest Hindu scientists of all times. He says:

saika-sa-gaccha-padānām kramāt-tri-saṃvargitasya ṣaṣṭho .aṃśaḥ |

varga-citi-ghanaḥ sa bhavet citi-vargo ghana-citi-ghanaś ca || AB 2.22

The sixth part of the product of the three quantities, viz. the number of terms, the number of terms plus one, and twice the number of terms plus one is the sum of the squares. The square of the sum of the (original) series is the sum of the cubes. [vide KS Shukla].

In modern language, we would render the first formula, which concerns us, as:

This is the formula for the figurate numbers known as the pyramidal numbers as they define square pyramids (Figure 1). A pratyakṣa geometric proof for this offered by the great Gārgya Nīlakaṇṭha somayājin (Figure 3). While this proof appears in Nīlakaṇṭha’s bhāṣya on the Āryabhaṭīyam, it is likely that some such proof was already known to Āryabhaṭa.

Figure 3. The formula for pyramidal numbers or the sum of squares of integers.

For bālabodhana:

1) He first asks you to lay a rectangular floor of cubic units.

2) Then you erect the walls on 3 of sides of the floor of height cubic units, namely the 2 sides of length and 1 side of length .

3) The shell thus constructed has:

floor

backwall

sidewalls

i.e. a total of cubic units or bricks.

From the figure, it is apparent that the shell can accommodate another shell based on , which in turn can accommodate one based on units and so on till 1. Thus, we can fill a cuboid of volume,

,

This yields Āryabhaṭa’s formula from which we can write the sequence of pyramidal numbers as:

**1, 5, 14, 30, 55, 91, 140, 204, 285, 385, 506, 650, 819, 1015, 1240…**

We had earlier seen Āryabhaṭa and Nīlakaṇṭha’s work on triangular numbers (sum of integers) and tetrahedral numbers (the sum of the sum of integers) [footnote 1]. From that, we know the formula for tetrahedral numbers to be:

**1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 286, 364, 455, 560, 680…**

We see that . This can be easily proven by seeing that merging two successive tetrahedral piles of spheres we get a square pyramid pile of balls (see figure in [footnote 1]). Shortly thereafter, this led us to finding for ourselves the space occupancy or density constant for atomic packing. Consider uniformly sized spherical atoms to be packed in a pyramid, like in Figure 1. Then the question is what fraction of the volume of the pyramid will be occupied by matter. We know that the volume of the pyramid whose side length is is , where is its height. From the bhujā-koṭi-karṇa-nyāya we have its height as . Hence,

Now the volume occupied by the atoms from Āryabhaṭa’s series sum is:

The radius of each atom is . Plugging this in the above we get:

Simplifying we get:

Since the atoms have infinitesimal radius we can take the limit and we are left with:

Thus, we get,

Hence, little under of the space occupied by solid matter is filled by uniform spherical atoms. This meditation on atomic packing led us to another way of counting squares. Imagine circles packed as in Figure 4. The circles can then be used to define squares. The most obvious set of squares is equivalent to the grid that we considered above. Here the smallest squares of the grid are equivalent to those circumscribing each circle, or alternative inscribed within it as shown in the example with just 1 circle. We can also join the centers of the circles and get bigger squares. If we instead circumscribe the circles we get an equivalent number corresponding to the bounding and interstitial squares of the grid. However, we notice (as shown in the example) that we can also get additional squares by joining the centers cross-ways. So the question was what is the total number of squares if we count in this manner?

Figure 4. Squares defined by packed circles.

We noticed that the first two cases will have the same number of squares as the pyramidal number case. However, from the case onward we will get additional squares. We noticed that for we get one additional square beyond the pyramidal numbers; for the case we get 4 additional squares. It can be seen that the number of additional squares essentially define tetrahedral numbers; thus, we can write the sequence of this mode of counting as below:

, when .

**1, 5, 15, 34, 65, 111, 175, 260, 369, 505, 671, 870, 1105, 1379, 1695…**

We can also derive this sequence in another way. Write the natural numbers thus:

**(1); (2,3); (4,5,6); (7,8,9,10); (11,12,13,14,15);…**

If we then take the sum of each group in brackets, which has elements, we get .

We observe that from the 3rd term onward this sequence remarkably yields the magic constants (row, column and diagonal sums or the largest eigenvalue of the matrix defined by the magic square) for the minimal magic squares (bhadra-s) i.e. magic squares made of numbers from where is the order or the side length of it [footnote 2]. We also realized then that this was the basis of the “magic choice” property which we used in a schoolyard trick. That is illustrated in Figure 5.

Figure 5. Magic choice.

Write a square of all integers from . Ask a person to silently randomly choose numbers such that each row and column of the square is represented once (orange circles in Figure 5) and sum them up. Then, without him revealing anything you tell him the sum. The sum will be . This is the weaker condition which can be converted to a magic square for all .

Finally, we will consider another sequence that can be derived like the above. It is the simple sum of pyramidal and tetrahedral numbers without shifting the latter by 2 terms as we did above to get . Thus, this new sequence is:

**2, 9, 24, 50, 90, 147, 224, 324, 450, 605, 792, 1014, 1274, 1575, 1920, 2312, 2754, 3249, 3800, 4410…**

We observe that this sequence defines the sum of the integers in the interstices between triangular numbers (Figure 6). Further, it also has a geometric interpretation in the form of the area of the triangular number trapezium (Figure 6). Successive, triangular number trapezia are defined by the following 4 points: . These trapezia always have an integral area equal to starting from 9.

Figure 6. Triangular number interstitial sums and integer area trapezia.

Footnote 1: https://manasataramgini.wordpress.com/2017/10/23/triangles-hexes-and-cubes/

Footnote 2: https://manasataramgini.wordpress.com/2017/05/14/the-magic-of-the-deva-ogdoad/