# Pyramidal number

A pyramidal number is a figurate number that represents a pyramid with a polygonal base and a given number of triangular sides. The term usually refers to square pyramidal numbers, which have a square base with four sides, but it can also refer to:

as well as to pyramids with higher numbers of sides [1]

The formula for an r-gonal pyramidal number is:

${\displaystyle P_{n}^{r}={\frac {3n^{2}+n^{3}(r-2)-n(r-5)}{6}},}$

with r ∈ , r ≥ 3.

This formula can be factorized as follows:

{\displaystyle {\begin{aligned}P_{n}^{r}={\frac {n(n+1)[n(r-2)-(r-5)]}{(2)(3)}}=\left[{\frac {n(n+1)}{2}}\right]\left[{\frac {n(r-2)-(r-5)}{3}}\right]=T_{n}\ \left[{\frac {n(r-2)-(r-5)}{3}}\right]\end{aligned}}.}