A recursive divisor function Question:
Function definition:
$$f(1)=1$$
$$f(p)=p$$ where $p$ is a prime, and
$$f(n)=\prod {f(d_n)}$$ where $d_n$ are the divisors of $n$ except $n$ itself.
End result: 
The end result of the function is when all divisors have been reduced to primes or 1.
Example:$$f(12)=f(2)f(3)f(4)f(6)=f(2)f(3)f(2)f(2)f(3)=f(2)^3f(3)^2=72$$
Question parts:  
(a) Find a general formula for $f(a^n)$ where $a$ is a prime and $n$ is a natural number.
(b) Find a general formula for $f(a^nb^m)$ (following same notation). [Note: $a$ and $b$ are unique primes. $n$ and $m$, however, may be equal.]
Attempts at solutions:  
(a) We have solved it. The solution is:
$a^{2^{n-2}}$ if $n≥2$,
$a$ if $n=1$.  
(b) As of yet, none of us (me and my colleagues) have come up with a solution. We have solved the special cases
$$f(ab^m)=a^{2^{m-1}} \times b^{(2^{m-2})(m+1)}$$
$$f(a^2b^m)=a^{(2^{m-1})(m+2)} \times b^{(2^{m-2})(m^2+5m+2)/2}$$
$$f(a^3b^m)=a^{(2^{m-1})(m^2+7m+8)/2} \times b^{(2^{m-2})(m^3+12m^2+29m+6)/6}$$
Update 1: $f(a^4b^m)$ has been solved as well.
$$f(a^4b^m)=a^{(2^{m-1})(m^3+15m^2+56m+48)/6} \times b^{(2^{m-2})(m^4+22m^3+131m^2+206m+24)/24}$$
An answer to the above questions is needed. A general formula for $f(n)$ is appreciated, along with an explanation.

So, the friend who originally came up with this question also came up with a solution for it.
$$f(a^mb^n)=a^{[F(m-1,n)]}\times{b^{[F(m,n-1)]}}$$
where
$$F(m,n)=\frac{1}{2}\sum_{i=0}^{min(m,n)}{2^{m+n-i}\times{(-1)^i}\times{\frac{(m+n-i)!}{(m-i)!(n-i)!i!}}}$$
Note: $[X]$ is smallest integer larger than $X$.
I believe the above is a correct answer to part (b) of the question. Now only an answer to the final part (which was not part of the original question) is needed, which is to find a general formula for $f(n)$ where $n$ is any natural number.
