If count is odd , it must be removed by dividing n by prime number .
if ( count % 2 ) ans *= 2 ; for ( let i = 3 ; i <= Math . sqrt ( n ) ; i += 2 ) { count = 0 ; while ( n % i == 0 ) { count ++ ; n /= i ; }