On this page
Motzkin numbers count paths and chord diagrams. If you know Catalan numbers, think of them as a cousin with one extra move: a flat step. Below are the definition, the recurrence, the Catalan link and all nine cases for n = 4.
What are Motzkin numbers?
The nth Motzkin number, M(n), is the number of ways to draw non-intersecting chords between n points on a circle, where not every point has to be touched by a chord (Wikipedia: Motzkin number).
The sequence is A001006 in the On-Line Encyclopedia of Integer Sequences and begins 1, 1, 2, 4, 9, 21, 51, 127, 323, 835 (OEIS A001006). The count starts at n = 0, so M(0) = 1 and M(4) = 9.
The numbers are named after Theodore Motzkin, whose 1948 paper gave a combinatorial formula for partitions of a polygon and for non-associative products (Motzkin, 1948).
The same numbers count Motzkin paths: paths from (0,0) to (n,0) using steps U = (1,1), F = (1,0) and D = (1,-1) (OEIS A001006) that never dip below the x-axis (Wikipedia: Motzkin number).
Why do chords and paths agree? Walk round the circle writing U where a chord opens, D where one closes and F at an unused point. Each D closes a chord that is already open, so the path never dips below the axis. Because chords cannot cross, each D must close the latest open chord, like a bracket, so the path records the chords. Our guide on how to count using a bijection shows more matchings like this.
How do you list all Motzkin paths for n = 4?
Sort the paths by their flat steps. U and D must balance, so there are 0, 2 or 4 flat steps.
No flat steps: UUDD and UDUD. That is 2 paths.
Two flat steps: FFUD, FUFD, FUDF, UFFD, UFDF, UDFF. Choose 2 of the 4 places for U and D, with U first: 6 paths.
Four flat steps: FFFF. That is 1 path.
Total: 2 + 6 + 1 = 9, which matches M(4) = 9.
Check with chords on 4 points: no chords, 1 way; one chord, any of 6 pairs; two chords, only the 2 pairings of neighbours, since the diagonals cross. Again 1 + 6 + 2 = 9, group for group.
What is the recurrence for Motzkin numbers?
The standard recurrence is M(n) = M(n-1) + the sum, for k from 0 to n-2, of M(k) x M(n-2-k), with M(0) = M(1) = 1 (Wikipedia: Motzkin number).
Why: if the first step is F, the rest is any Motzkin path of length n-1. If it is U, find the first D that returns to the axis. Between them sits a raised path of length k; after them, a path of length n-2-k. Multiply, then add over k.
Check it against the terms you know:
M(4) = 4 + (2 + 1 + 2) = 9
M(5) = 9 + (4 + 2 + 2 + 4) = 21
M(6) = 21 + (9 + 4 + 4 + 4 + 9) = 51
The same page gives a faster two-term version: (n+2)M(n) = (2n+1)M(n-1) + 3(n-1)M(n-2). For n = 4: 6M(4) = 9 x 4 + 9 x 2 = 54, so M(4) = 9.
How are Motzkin numbers related to Catalan numbers?
The Catalan number C(k) counts the same kind of path of length 2k with no flat steps. With C(k) = (2k choose k)/(k+1), they run 1, 1, 2, 5, 14.
Each Motzkin number is a sum of Catalan numbers: M(n) = the sum over k of (n choose 2k) x C(k) (Wikipedia: Motzkin number and OEIS A001006). The reason: choose which 2k of the n steps are not flat, then fill those with a flat-free path.
For n = 4 this is 1 x 1 + 6 x 1 + 1 x 2 = 9, the same three groups as the list above. For n = 6 it is 1 + 15 x 1 + 15 x 2 + 1 x 5 = 51.
Paths that must stay above a line also drive the ballot problem and the reflection principle.
How should you practise counting problems like this?
Use this routine on any new counting sequence:
List cases n = 0 to 4 by hand; trust no formula until it matches.
Group cases by one feature, such as flat steps; groups often become a formula's terms.
Split on the first step or first return to get a recurrence.
Check your terms against the OEIS.
To revise the ideas around it, the Fermi Concept Library covers every concept in mathematics alongside physics, chemistry, biology and computing. When a count goes wrong, the Fermi Problem Library has a step-by-step solver that explains the reasoning. Then start on n = 5 and see if you reach 21.



