A pyramidal number is a figurate number that represents a pyramid with a polygonal base and a given number of triangular sides. A pyramidal number is the number of points in a pyramid where each layer of the pyramid is an r-sided polygon of points. The term often refers to square pyramidal numbers, which have a square base with four sides, but it can also refer to pyramids with three or more sides. The numbers of points in the base (and in parallel layers to the base) are given by polygonal numbers of the given number of sides, while the numbers of points in each triangular side is given by a triangular number. It is possible to extend the pyramidal numbers to higher dimensions.
The formula for the nth r-gonal pyramidal number is
where r ∈ [], r ≥ 3. 
This formula can be factored:
where Tn is the nth triangular number.
The first few triangular pyramidal numbers (equivalently, tetrahedral numbers) are:
The first few square pyramidal numbers are:
The first few pentagonal pyramidal numbers are:
- 1, 6, 18, 40, 75, 126, 196, 288, 405, 550, 726, 936, 1183, 1470, 1800, 2176, 2601, 3078, 3610, 4200, 4851, 5566, 6348, 7200, 8125, 9126 (sequence A002411 in the OEIS).
The first few hexagonal pyramidal numbers are:
The first few heptagonal pyramidal numbers are:
- Weisstein, Eric W. "Pyramidal Number". MathWorld.
- Sloane, N. J. A. (ed.). "Sequence A002414". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation.
- Beiler, Albert H. (1966), Recreations in the Theory of Numbers: The Queen of Mathematics Entertains, Courier Dover Publications, p. 194, ISBN 9780486210964.