finding subterms in a bigger term



I do not understand your specification.

Consider  gamma(k)=(k-1) gamma(k-1).
so
(gamma (a + 1) gamma (b + 1) gamma (b + a + 3)

 is equal to  a*b*(a+b+2)*(a+b+1)*(a+b)* gamma(a)*gamma(b)*gamma(a+b).

Is this what you want?