Calculate Catalan numbers.