Let $p(n)$ be the product of the exponents of the prime factorization of $n$. For example,
$$p(5184) = p(2^6 3^4) = 24 \;,$$
$$p(65536) = p(2^{16}) = 16 \;.$$
Define $P(n)$ as the number of iterations of $p(\;)$ to reduce $n$ to $1$. For example,
$P(5184) = 3$ because 
$$p(5184)=24, \;p(24) = p(2^3 3^1) = 3, \;p(3)=1 \;;$$
and $P(65536)=4$ because
$$p(65536) = 16, \;p(16)=p(2^4)=4, \;p(4)=p(2^2)=2, \; p(2)=1 \;.$$
Finally, define $m(k)$ to be the minimum value of $n$ such that $P(n) = k$.



> 
> **Q1**. What is $m(k)$?
> 
> 
> 


(I ask this question out of curiosity, not because it is part of a research program.
It was [previously posed on MSE](https://math.stackexchange.com/q/507909/237).)


It is easy to see that $m(1)=2$, $m(2)=4$, and $m(3)=16$, the latter because $16=2^{2^2}$. But, thanks to [Calvin Lin's insight](https://math.stackexchange.com/a/507914/237), $m(4)$ is not a power of $2$, but instead is $m(4)=1296= 2^4 3^4$. I do not know the value of $m(5)$.



> 
> **Q2**. More specifically: What is $m(5)$?
> 
> 
> 


I do know that $m(5) > 2 \times 10^8$.


---

**Update**.
Will Jagy showed that almost certainly
$m(5) = 2^9 3^6 5^4 7^3 11^2 =9681819840000 \approx 10^{13}$.
As it seems that an explicit expression for $m(k)$ is not in the offing,
I will accept his resolution of **Q2** and leave **Q1** open.



Product of exponents of prime factorization
Well, make it an answer. The simple observation, also true for highly composite numbers (which resemble this problem) is that getting a large value of $p(n)$ means $n$ has non-increasing exponents in its prime factorization. Furthermore, no exponent is exactly $1.$ 


So, I am not entirely convinced that $p(m(5)) = 1296.$ Maybe, maybe not. However, i am convinced that if you go up to eight primes,
$$ n = 2^a 3^b 5^c 7^d 11^e 13^f 17^g 19^h $$
with $a \geq b \geq c \geq d \geq e \geq f \geq g \geq h \geq 0$ and none exactly 1, and loops with built-in bounds reflecting $n > 2 \cdot 10^8,$ you will find the winner. NOTE: it turns out that this was true: since $$(2 \cdot 3 \cdot 5 \cdot 7 \cdot 11 \cdot 13 \cdot 17 \cdot 19)^2 \approx 9.4 \cdot 10^{13}$$ and we found out we could do slightly better than $10^{13},$ and any prime we use has an exponent at least $2,$ it follows that we do not need to use any prime bigger than $17.$


Oh, if $h=0,$ for example, you do not multiply that in. The HC and superabundant numbers behave better in this regard. Put another way, your $p$ is almost multiplicative, but not unless you take care to build in $p(1) = 1.$


NOTE: I see no hope of finding $m(6)$ unless we can prove that $p(m(6)) = m(5),$ and it is still a stretch in that case.


BEST  

$$ 2^9 3^6 5^4 7^3 11^2 \approx e^{29.9013} \approx 9.7 \cdot 10^{12}$$


MUCH more careful computer run. No specific bounds on the exponents, just the requirement that the resulting product $n < e^{37},$ done using the logarithms. My original guess that $6$ was a reasonable upper bound on the exponents was just that, a guess, and not a good one. Mostly, you don't get enough benefit from extra large (or extra small) exponents on 2, and you don't get enough benefit out of $p(n)$ moving from 1296 to 2304 or 3600



```
  log n          p(n)           2  3  5  7 11 13 17 19
-------------------------------------------------------------
 29.9013        1296            9  6  4  3  2  0  0  0
 29.9966        1296            8  6  3  3  3  0  0  0
 30.1019        1296            9  4  4  3  3  0  0  0
 30.2197        1296            6  6  4  3  3  0  0  0
 30.2703        1296            9  6  6  4  0  0  0  0
 30.3472        1296            9  9  4  4  0  0  0  0
 30.3713        1296           12  6  3  3  2  0  0  0
 30.4038        1296           12  6  6  3  0  0  0  0
 30.4808        1296           12  9  4  3  0  0  0  0
 30.4891        1296            9  8  3  3  2  0  0  0
 30.5216        1296            9  8  6  3  0  0  0  0
 30.5719        1296           12  4  3  3  3  0  0  0
 31.0407        1296            6  6  6  3  2  0  0  0
 31.1742        1296            9  6  6  2  2  0  0  0
 31.2245        1296            9  4  3  3  2  2  0  0
 31.2512        1296            9  9  4  2  2  0  0  0
 31.3423        1296            6  6  3  3  2  2  0  0
 31.3438        1296           18  6  4  3  0  0  0  0
 31.4758        1296            9  6  3  2  2  2  0  0
  31.543        1296            6  4  3  3  3  2  0  0
 31.6439        1296           16  9  3  3  0  0  0  0
 31.7212        1296           12  9  3  2  2  0  0  0
 31.7537        1296           12  9  6  2  0  0  0  0
 31.8306        1296            8  3  3  3  3  2  0  0
 31.9316        1296           18  8  3  3  0  0  0  0
 32.0826        1296            6  6  6  6  0  0  0  0
 32.1672        1296           12 12  3  3  0  0  0  0
 32.2053        1296           12  3  3  3  2  2  0  0
 32.2459        1296           16  3  3  3  3  0  0  0
 32.3329        1296           18  4  3  3  2  0  0  0
 32.4662        1296            9  6  4  3  2  1  0  0
 32.5615        1296            8  6  3  3  3  1  0  0
 32.5842        1296           18  6  3  2  2  0  0  0
 32.6168        1296           18  6  6  2  0  0  0  0
 32.6669        1296            9  4  4  3  3  1  0  0
 32.6682        1296            9  6  6  4  1  0  0  0
 32.6937        1296           18  9  4  2  0  0  0  0
 32.7216        1296            4  4  3  3  3  3  0  0
 32.7451        1296            9  9  4  4  1  0  0  0
 32.7847        1296            6  6  4  3  3  1  0  0
 32.8017        1296           12  6  6  3  1  0  0  0
 32.8787        1296           12  9  4  3  1  0  0  0
 32.8932        1296            9  9  8  2  0  0  0  0
 32.9195        1296            9  8  6  3  1  0  0  0
 32.9362        1296           12  6  3  3  2  1  0  0
  33.054        1296            9  8  3  3  2  1  0  0
 33.1369        1296           12  4  3  3  3  1  0  0
 33.1622        1296            9  9  2  2  2  2  0  0
 33.5519        2304            8  6  4  4  3  0  0  0
 33.6057        1296            6  6  6  3  2  1  0  0
 33.7129        1296            6  3  3  3  2  2  2  0
 33.7392        1296            9  6  6  2  2  1  0  0
 33.7417        1296           18  6  4  3  1  0  0  0
 33.8032        2304            8  8  4  3  3  0  0  0
 33.8161        1296            9  9  4  2  2  1  0  0
 33.8464        1296            9  3  3  2  2  2  2  0
 33.8933        1296           24  6  3  3  0  0  0  0
 33.9266        2304           12  6  4  4  2  0  0  0
 34.0418        1296           16  9  3  3  1  0  0  0
 34.0444        2304            9  8  4  4  2  0  0  0
 34.0577        1296            9  4  3  3  2  2  1  0
 34.1273        2304           12  4  4  4  3  0  0  0
 34.1516        1296           12  9  6  2  1  0  0  0
 34.1755        1296            6  6  3  3  2  2  1  0
 34.1779        2304           12  8  4  3  2  0  0  0
 34.2706        1296           18  9  2  2  2  0  0  0
 34.2862        1296           12  9  3  2  2  1  0  0
  34.309        1296            9  6  3  2  2  2  1  0
 34.3295        1296           18  8  3  3  1  0  0  0
  34.338        2304            8  6  4  3  2  2  0  0
 34.3729        2304            8  6  6  4  2  0  0  0
 34.3762        1296            6  4  3  3  3  2  1  0
 34.3801        1296           18 12  3  2  0  0  0  0
 34.4183        1296           18  3  3  2  2  2  0  0
 34.4457        2304            9  4  4  4  4  0  0  0
 34.4805        1296            6  6  6  6  1  0  0  0
 34.5387        2304            8  4  4  3  3  2  0  0
 34.5469        2304           12  8  6  4  0  0  0  0
 34.5635        2304            6  6  4  4  4  0  0  0
 34.5651        1296           12 12  3  3  1  0  0  0
 34.6242        2304            8  8  6  3  2  0  0  0
 34.6639        1296            8  3  3  3  3  2  1  0
 34.7245        1296            4  3  3  3  3  2  2  0
 34.7533        2304           16  6  4  3  2  0  0  0
 34.7799        2304            9  4  4  4  2  2  0  0
 34.8109        1296           16  3  3  3  3  1  0  0
 34.8976        2304            6  6  4  4  2  2  0  0
 34.8979        1296           18  4  3  3  2  1  0  0
 34.9134        2304           12  4  4  3  2  2  0  0
 34.9258        2304            8  8  3  3  2  2  0  0
  34.954        2304           16  4  4  3  3  0  0  0
 35.0147        1296           18  6  6  2  1  0  0  0
 35.0385        1296           12  3  3  3  2  2  1  0
 35.0916        1296           18  9  4  2  1  0  0  0
 35.0983        2304            6  4  4  4  3  2  0  0
 35.1223        2304           16  6  6  4  0  0  0  0
 35.1492        1296           18  6  3  2  2  1  0  0
 35.1647        2304           12  6  4  2  2  2  0  0
 35.1993        2304           16  9  4  4  0  0  0  0
 35.2331        1296            9  6  6  4  1  1  0  0
 35.2397        1296           18  9  8  0  0  0  0  0
 35.2432        1296           24  9  3  2  0  0  0  0
 35.2825        2304            9  8  4  2  2  2  0  0
 35.2911        1296            9  9  8  2  1  0  0  0
 35.2994        1296            9  6  4  3  2  1  1  0
 35.3101        1296            9  9  4  4  1  1  0  0
 35.3166        1296           18 12  6  0  0  0  0  0
 35.3411        2304           16  8  3  3  2  0  0  0
 35.3666        1296           12  6  6  3  1  1  0  0
 35.3736        2304           16  8  6  3  0  0  0  0
 35.3849        1296           27  4  4  3  0  0  0  0
 35.3932        1296           24  3  3  3  2  0  0  0
 35.3947        1296            8  6  3  3  3  1  1  0
 35.4436        1296           12  9  4  3  1  1  0  0
 35.4509        2304           12  8  6  2  2  0  0  0
 35.4628        1296           16  9  9  0  0  0  0  0
 35.4844        1296            9  8  6  3  1  1  0  0
 35.4869        2304           18  8  4  4  0  0  0  0
 35.5001        1296            9  4  4  3  3  1  1  0
 35.5548        1296            4  4  3  3  3  3  1  0
  35.611        2304            8  6  6  2  2  2  0  0
 35.6179        1296            6  6  4  3  3  1  1  0
 35.6362        1296           27  6  4  2  0  0  0  0
 35.6662        2304            8  8  6  6  0  0  0  0
 35.6864        2304            9  8  8  4  0  0  0  0
 35.7225        2304           12 12  4  4  0  0  0  0
 35.7525        2304           12  8  3  2  2  2  0  0
 35.7694        1296           12  6  3  3  2  1  1  0
 35.8199        2304           12  8  8  3  0  0  0  0
 35.8872        1296            9  8  3  3  2  1  1  0
 35.8883        2304           18  4  4  4  2  0  0  0
 35.9701        1296           12  4  3  3  3  1  1  0
 35.9861        1296           12 12  9  0  0  0  0  0
 35.9954        1296            9  9  2  2  2  2  1  0
 36.0263        2304           16  6  6  2  2  0  0  0
 36.0765        2304           16  4  3  3  2  2  0  0
 36.1032        2304           16  9  4  2  2  0  0  0
 36.1169        2304            8  6  4  4  3  1  0  0
 36.1797        1296           24  9  6  0  0  0  0  0
 36.1978        2304            8  4  3  3  2  2  2  0
  36.224        1296           27  8  3  2  0  0  0  0
  36.277        2304            4  4  4  4  3  3  0  0
 36.2911        1296           24  6  3  3  1  0  0  0
 36.3066        1296           18  6  4  3  1  1  0  0
 36.3279        2304           16  6  3  2  2  2  0  0
 36.3682        2304            8  8  4  3  3  1  0  0
 36.3909        2304           18  8  4  2  2  0  0  0
 36.4209        2304            6  4  4  3  2  2  2  0
 36.4389        1296            6  6  6  3  2  1  1  0
 36.4491        2304            8  6  3  2  2  2  2  0
 36.4916        2304           12  6  4  4  2  1  0  0
 36.5477        3600           10  6  5  4  3  0  0  0
 36.5492        2304           16 12  4  3  0  0  0  0
 36.5545        2304            9  4  4  2  2  2  2  0
 36.5724        1296            9  6  6  2  2  1  1  0
 36.5903        2304            9  8  8  2  2  0  0  0
 36.6068        1296           16  9  3  3  1  1  0  0
 36.6094        2304            9  8  4  4  2  1  0  0
 36.6253        1296           27  4  3  2  2  0  0  0
 36.6265        2304           12 12  4  2  2  0  0  0
 36.6494        1296            9  9  4  2  2  1  1  0
 36.6573        1296            6  3  3  3  2  2  2  1
 36.6722        2304            6  6  4  2  2  2  2  0
 36.6922        2304           12  4  4  4  3  1  0  0
 36.7166        1296           12  9  6  2  1  1  0  0
 36.7429        2304           12  8  4  3  2  1  0  0
  36.778        1296           18 12  3  2  1  0  0  0
 36.7909        1296            9  3  3  2  2  2  2  1
  36.799        3600           10  8  5  3  3  0  0  0
 36.8353        3600           12  5  5  4  3  0  0  0
 36.8356        1296           18  9  2  2  2  1  0  0
 36.8944        1296           18  8  3  3  1  1  0  0
 36.9379        2304            8  6  6  4  2  1  0  0
 36.9448        2304           12  8  6  4  1  0  0  0

```

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


C++



```
int OROURKE(int i)
{
  int joe = 1;

  int p = 2;
  int temp = i;
  if (temp < 0 )
  {
    temp *= -1;

  }


  if ( temp > 1)
  {
    int primefac = 0;
    while( temp > 1 && p * p <= temp)
    {
      if (temp % p == 0)
      {
        ++primefac;

        temp /= p;
        int exponent = 1;
        while (temp % p == 0)
        {
          temp /= p;
          ++exponent;
        } // while p is fac
        if ( exponent > 1)
        {

          joe *= exponent ;
        }
      }  // if p is factor
      ++p;
    } // while p

  } // temp > 1
  return joe;
} // OROURKE



int main()
{

     cout << endl;
     double luge = 0.0;
  double luge_a = 0.0, luge_b = 0.0, luge_c = 0.0, luge_d = 0.0, luge_e = 0.0, luge_f = 0.0, luge_g = 0.0, luge_h = 0.0;

     for( int a = 2; a <= 100 &&  a * log(2.0) < 37.0; ++a){

       luge_a =  a * log(2.0);
       luge = luge_a;

     for (int b = 0; b <= a && luge_a + b * log(3.0) < 37.0; ++b){
        luge_b = luge_a + b * log(3.0) ;
         luge = luge_b;

     for( int c = 0; c <= b && luge_b + c * log(5.0) < 37.0; ++c){
       luge_c = luge_b + c * log(5.0) ;
         luge = luge_c;

     for(int d = 0; d <= c && luge_c + d * log(7.0) < 37.0; ++d) {
          luge_d = luge_c + d * log(7.0) ;
         luge = luge_d;

     for(int e = 0; e <= d && luge_d + e * log(11.0)  < 37.0; ++e){
               luge_e = luge_d + e * log(11.0) ;
         luge = luge_e;

     for(int f = 0; f <= e && luge_e + f * log(13.0) < 37.0; ++f){
              luge_f = luge_e + f * log(13.0) ;
         luge = luge_f;

     for(int g = 0; g <= f && luge_f + g * log(17.0) < 37.0; ++g) {
            luge_g = luge_f + g * log(17.0) ;
         luge = luge_g;

     for(int h = 0; h <= g && luge_g + h * log(19.0) < 37.0; ++h){
            luge_h = luge_g + h * log(19.0) ;
         luge = luge_h;

        int oro = 1;
        if ( a > 1) oro *= a; 
       if ( b > 1) oro *= b; 
       if ( c > 1) oro *= c; 
       if ( d > 1) oro *= d; 
       if ( e > 1) oro *= e; 
       if ( f > 1) oro *= f;   
     if ( g > 1) oro *= g; 
       if ( h > 1) oro *= h; 
       if (  OROURKE(OROURKE(OROURKE(oro))) != 1 &&   OROURKE(OROURKE(OROURKE(OROURKE(oro)))) == 1  && luge < 37.0  )       cout << setw(12) << luge << setw(12) << oro << setw(13) << a  << setw(3) << b << setw(3) << c << setw(3) << d << setw(3) << e << setw(3) << f << setw(3) << g << setw(3) << h << endl;

     }}}}}}}}  // abcdefgh




    return 0 ;
}

```

