# Square pyramidal number

Jump to navigation Jump to search

In mathematics, a pyramid number, or square pyramidal number, is a figurate number that represents the number of stacked spheres in a pyramid with a square base. The square pyramidal numbers can be used to count number of squares in an n × n grid, or acute triangles in 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.

## Formula Play media
Six copies of a square pyramid with n steps can fit in a cuboid of size n(n + 1)(2n + 1)

The first few square pyramidal numbers are:

1, 5, 14, 30, 55, 91, 140, 204, 285, 385, 506, 650, 819, ... .

These numbers can be expressed in a formula as

{\begin{aligned}P_{n}&=\sum _{k=1}^{n}k^{2}=1+4+9+\cdots +n^{2}\\&={\frac {n(n+1)(2n+1)}{6}}={\frac {2n^{3}+3n^{2}+n}{6}}={\frac {n^{3}}{3}}+{\frac {n^{2}}{2}}+{\frac {n}{6}}.\\\end{aligned}} The summation in the formula represents the decomposition of a pyramid into its square layers. Its equality with a cubic polynomial is a special case of Faulhaber's formula, and may be proved by mathematical induction. Equivalent formulas are given by Archimedes and Fibonacci.

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.

## Geometric enumeration

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 boxes found in the grid is n2.
• The number of 2 × 2 boxes found in the grid is (n − 1)2. These can be counted by counting all of the possible upper-left corners of 2 × 2 boxes.
• The number of k × k boxes (1 ≤ kn) found in the grid is (nk + 1)2. These can be counted by counting all of the possible upper-left corners of k × k boxes.

It follows that the number of squares in an n × n square grid is:

$n^{2}+(n-1)^{2}+(n-2)^{2}+(n-3)^{2}+\ldots +1^{2}={\frac {n(n+1)(2n+1)}{6}}.$ That is, the solution to the puzzle is given by the square pyramidal numbers.

The square pyramidal number $P_{n}$ also counts the number of acute triangles formed from the vertices of a $(2n+1)$ -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.

The number of rectangles in a square grid is given by the squared triangular numbers.

## Relations to other figurate numbers

The cannonball problem asks 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 square pyramidal numbers can be expressed as sums of binomial coefficients:

$P_{n}={\binom {n+2}{3}}+{\binom {n+1}{3}}.$ 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,

$4P_{n}={\binom {2n+2}{3}}.$ ## Other properties

The alternating series of unit fractions with the square pyramidal numbers as denominators is closely related to the Leibniz formula for π, although it converges more quickly. It is:

{\begin{aligned}\sum _{i=1}^{\infty }&(-1)^{i-1}{\frac {1}{P_{i}}}\\&=1-{\frac {1}{5}}+{\frac {1}{14}}-{\frac {1}{30}}+{\frac {1}{55}}-{\frac {1}{91}}+{\frac {1}{140}}-{\frac {1}{204}}+\cdots \\&=6(\pi -3)\\&\approx 0.849556.\\\end{aligned}} 