As well as counting spheres in a pyramid, these numbers can be used to solve several other counting problems, including counting squares in a square grid and counting acute triangles formed from the vertices of an odd regular polygon. They equal the sums of consecutive tetrahedral numbers, and are one-fourth of a larger tetrahedral number. The sum of two consecutive square pyramidal numbers is an octahedral number.
In modern mathematics, figurate numbers are formalized by the Ehrhart polynomials. The Ehrhart polynomial L(P,t) of a polyhedron P is a polynomial that counts the number of integer points in a copy of P that is expanded by multiplying all its coordinates by the number t. The Ehrhart polynomial of a pyramid whose base is a unit square with integer coordinates, and whose apex is an integer point at height one above the base plane, is (t + 1)(t + 2)(2t + 3)/6 = Pt + 1.
All 30 squares in a 4×4 grid
A common mathematical puzzle involves finding the number of squares in a large n by n square grid. This number can be derived as follows:
The number of 1 × 1 squares found in the grid is n2.
The number of 2 × 2 squares found in the grid is (n − 1)2. These can be counted by counting all of the possible upper-left corners of 2 × 2 squares.
The number of k × k squares (1 ≤ k ≤ n) found in the grid is (n − k + 1)2. These can be counted by counting all of the possible upper-left corners of k × k squares.
It follows that the number of squares in an n × n square grid is:
That is, the solution to the puzzle is given by the nth square pyramidal number.
The square pyramidal number also counts the number of acute triangles formed from the vertices of a -sided regular polygon. For instance, an equilateral triangle contains only one acute triangle (itself), a regular pentagon has five acute golden triangles within it, a regular heptagon has 14 acute triangles of two shapes, etc.
4900 balls arranged as a square pyramid of side 24, and a square of side 70
The cannonball problem asks for the sizes of pyramids that can also be spread out to form a square array of cannonballs, or equivalently, which numbers are both square and square pyramidal.
Besides 1, there is only one other number that has this property: 4900, which is both the 70th square number and the 24th square pyramidal number. This fact was proven by G. N. Watson in 1918.
The binomial coefficients occurring in this representation are tetrahedral numbers, and this formula expresses a square pyramidal number as the sum of two tetrahedral numbers in the same way as square numbers are the sums of two consecutive triangular numbers. If a tetrahedron is reflected across one of its faces, the two copies form a triangular bipyramid. The square pyramidal numbers are also the figurate numbers of the triangular bipyramids, and this formula can be interpreted as an equality between the square pyramidal numbers and the triangular bipyramidal numbers. Analogously, reflecting a square pyramid across its base produces an octahedron, from which it follows that each octahedral number is the sum of two consecutive square pyramidal numbers.
Square pyramidal numbers are also related to tetrahedral numbers in a different way: the points from four copies of the same square pyramid can be rearranged to form a single tetrahedron of slightly more than twice the edge length. That is,
^Beck, M.; De Loera, J. A.; Develin, M.; Pfeifle, J.; Stanley, R. P. (2005), "Coefficients and roots of Ehrhart polynomials", Integer Points in Polyhedra—Geometry, Number Theory, Algebra, Optimization, Contemporary Mathematics, 374, Providence, Rhode Island: American Mathematical Society, pp. 15–36, arXiv:math/0402148, MR 2134759
^Duffin, Janet; Patchett, Mary; Adamson, Ann; Simmons, Neil (November 1984), "Old squares new faces", Mathematics in School, 13 (5): 2–4, JSTOR 30216270
^Robitaille, David F. (May 1974), "Mathematics and chess", The Arithmetic Teacher, 21 (5): 396–400, JSTOR 41190919
^Alsina, Claudi; Nelsen, Roger B. (2015), "Challenge 2.13", A Mathematical Space Odyssey: Solid Geometry in the 21st Century, The Dolciani Mathematical Expositions, 50, Washington, DC: Mathematical Association of America, pp. 43, 234, ISBN 978-0-88385-358-0, MR 3379535