How this calculation works
A balanced sequence never closes more parentheses than it has opened in any prefix.
Cₙ = binom(2n,n)/(n+1)A worked example
Five pairs can form 42 balanced strings.
Good to know
The index starts at zero.
Reference: NIST DLMF, Functions of Number Theory (opens in a new tab) ↗
Read the result
Count balanced parentheses strings with n pairs, among other Catalan structures.
The primary result is labeled “Catalan number”. Keep the input definitions in view when comparing this result with another method.
Try a related calculation
The index starts at zero.
For a related exercise, try the greatest common divisor.
A few questions, answered
How can I check the default inputs by hand?
Five pairs can form 42 balanced strings.
Which rule does this calculator apply?
Cₙ = binom(2n,n)/(n+1)