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.

I Found
$$f(a^n\cdot b^m) = a^{{(2^{m})}{(m-1)}} \cdot b^{{(2^{m-2})}{(m+1)}} \cdot \prod _{j=1} ^{m} \prod _{i=1} ^{n-1} f(a^i\cdot b^{j})^{2^{m-j}}$$