In mathematics, a pyramid number, or square pyramidal number, is a natural number that counts the stacked spheres in a pyramid with a square base. The study of these numbers goes back to Archimedes and Fibonacci. They are part of a broader topic of figurate numbers representing the numbers of points forming regular patterns within different shapes.
A square pyramid of cannonballs at Rye Castle in England
In number theory, an octahedral number is a figurate number that represents the number of spheres in an octahedron formed from close-packed spheres. The th octahedral number can be obtained by the formula:
146 magnetic balls, packed in the form of an octahedron