Mathwords logoMathwords

Square Pyramidal Number — Definition, Formula & Examples

A square pyramidal number is the total number of objects in a pyramid with square layers, where the kk-th layer from the top is a k×kk \times k square. Equivalently, it is the sum of the first nn perfect squares: 1+4+9++n21 + 4 + 9 + \cdots + n^2.

The nn-th square pyramidal number PnP_n is defined as Pn=k=1nk2P_n = \sum_{k=1}^{n} k^2, which equals n(n+1)(2n+1)6\frac{n(n+1)(2n+1)}{6}. The sequence begins 1,5,14,30,55,91,1, 5, 14, 30, 55, 91, \ldots for n=1,2,3,n = 1, 2, 3, \ldots

Key Formula

Pn=k=1nk2=n(n+1)(2n+1)6P_n = \sum_{k=1}^{n} k^2 = \frac{n(n+1)(2n+1)}{6}
Where:
  • PnP_n = The n-th square pyramidal number
  • nn = The number of square layers in the pyramid

How It Works

Imagine stacking square layers to build a pyramid. The top layer has 12=11^2 = 1 ball, the next has 22=42^2 = 4, then 32=93^2 = 9, and so on. The square pyramidal number counts the total balls in the entire stack. You can compute it by adding squares one at a time or by using the closed-form formula directly.

Worked Example

Problem: Find the 5th square pyramidal number.
Step 1: Write out the sum of the first 5 perfect squares.
P5=12+22+32+42+52=1+4+9+16+25P_5 = 1^2 + 2^2 + 3^2 + 4^2 + 5^2 = 1 + 4 + 9 + 16 + 25
Step 2: Alternatively, apply the closed-form formula with n = 5.
P5=56116=3306=55P_5 = \frac{5 \cdot 6 \cdot 11}{6} = \frac{330}{6} = 55
Answer: The 5th square pyramidal number is 5555.

Visualization

Why It Matters

Square pyramidal numbers appear in combinatorics and physics — for instance, counting the number of squares of all sizes on an n×nn \times n chessboard. They also serve as a gateway to understanding summation formulas and polynomial closed forms, which are essential in discrete mathematics and computer science algorithm analysis.

Common Mistakes

Mistake: Confusing square pyramidal numbers with tetrahedral numbers.
Correction: Tetrahedral numbers sum triangular numbers (1+3+6+1 + 3 + 6 + \cdots), while square pyramidal numbers sum perfect squares (1+4+9+1 + 4 + 9 + \cdots). The formulas are different: tetrahedral uses n(n+1)(n+2)6\frac{n(n+1)(n+2)}{6}, square pyramidal uses n(n+1)(2n+1)6\frac{n(n+1)(2n+1)}{6}.