# Square pyramidal number

As well as counting spheres in a pyramid, these numbers can be described algebraically as a sum of the first ${\displaystyle n}$ positive square numbers, or as the values of a cubic polynomial. They 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.