count the number for each prime factor
for ( var i = 3 ; i <= Math . sqrt ( n ) ; i += 2 ) { while ( n % i == 0 ) { n = n / i ; if ( count . has ( i ) ) { count . set ( i , count . get ( i ) + 1 ) ; } else { count . set ( i , 1 ) ; } } } if ( n > 2 ) { if ( count . has ( n ) ) { count . set ( n , count . get ( n ) + 1 ) ; } else { count . set ( n , 1 ) ; } } var flag = 0 ; const iterator = count [ Symbol . iterator ] ( ) ; let itr = iterator . next ( ) for ( let i = 0 ; i < count . size ; i ++ ) {