Catalan number calculations.