Determining if n is of the form m^k?



Is there a fast and easy way (beside repeated division) to determine
if the integer n is of the form m^k?

One of the outstanding bugs is that maxima leaves 2*2^k as is, instead
of simplifying it to 2^(k+1).  However a*a^k is simplified to a^(k+1).

I have a fix for 2*2^k (and other integers), but it currently only
works for that case.  It won't handle 4*2^k or 1/4*2^k.  Hence, I'm
looking a fast and simple way to determine if n is of the form m^k.

Ray