Something like that, I think.
Код:
int catalan(int num,int den,int n)
{
if (n==0)
return num/den;
return catalan(2*(2*n-1)*num,den*(n+1),n-1);
}
Should be called initially as "catalan(1,1,n)".
Perhaps, num and den can be divided by their GCD at each iteration, I guess.