How to collect the common powers appearing in the following function using MATHEMATICA, such that if I input
(4 m^6)/((m - n)^2 (m + n)^4 (2m+n)^4)
then the output should be displayed as
((2 m^3)/((m - n) (m + n)^2 (2m+n)^2))^2
Edit: In general if there are many terms with different powers in both the numerator and the denominator then what is required is the GCD of all the powers of the terms in both the numerator and the denominator. For example if we have follows
(a1^(n1)a2^(n2)a3^(n3)a4^(n4)...a^(nn))/(b1^(m1)b2^(m2)b3^(m3)b4^(m4)...bm^(mm))
The what could be taken as the common power is the
GCD(n1,n2,...,nn,m1,m2,m3....mm)