Loop to count the number of the prime factors of the given number
for ( let i = 3 ; i <= Math . sqrt ( n ) ; i += 2 ) { while ( n % i == 0 ) { cnt ++ ; n = parseInt ( n / i ) ; } } if ( n > 2 ) cnt ++ ; return cnt ; }