Quant Memo
Foundational

Figurate and Polygonal Numbers

Figurate numbers count the dots needed to build a shape — a triangle, square, or pentagon — one layer bigger each time, giving simple closed-form formulas that a surprising number of interview counting puzzles reduce to.

Figurate numbers count how many dots it takes to arrange a shape of a given size, growing that shape one ring or row at a time. The most familiar is the triangular numbers — 1, 3, 6, 10, 15 — formed by stacking rows of 1, 2, 3, 4, 5 dots into a triangle, giving the formula Tn=n(n+1)/2T_n = n(n+1)/2. Square numbers — 1, 4, 9, 16 — are just n2n^2, formed by an n×nn \times n grid of dots. More generally, the polygonal number for a kk-sided regular polygon of "size" nn is given by P(k,n)=(k2)n2(k4)n2P(k,n) = \frac{(k-2)n^2 - (k-4)n}{2}, which reduces to the triangular formula at k=3k=3 and the square formula at k=4k=4.

These show up in interviews less as "recite the formula" and more as counting puzzles in disguise: how many handshakes happen among nn people (triangular numbers, since it is choosing 2 out of nn), or how many unit squares are in a triangular grid of side nn. Recognizing that a count is secretly a figurate number turns a fiddly enumeration into a one-line closed form. A useful identity worth memorizing is that every square number is the sum of two consecutive triangular numbers: Tn1+Tn=n2T_{n-1} + T_n = n^2, which follows directly from stacking two staircases of dots into a square.

Figurate numbers are dot-counts for growing regular shapes, with closed forms like Tn=n(n+1)/2T_n = n(n+1)/2 for triangles and n2n^2 for squares; spotting that an interview counting problem is secretly a figurate number replaces manual enumeration with a one-line formula.

Related concepts

Practice in interviews

ShareTwitterLinkedIn