Function that calculate the count of each prime factor of a number
function primeFactorize ( a ) { for ( let i = 2 ; i * i <= a ; i += 2 ) { let cnt = 0 ; while ( a % i == 0 ) { cnt ++ ; a = parseInt ( a / i , 10 ) ; } ma . set ( i , cnt ) ; } if ( a > 1 ) { ma . set ( a , 1 ) ; } }