human
Minimum divisor of a number to make the number perfect cube | Returns the minimum divisor.
Since 2 is only even prime , compute its power seprately ..
If count is not divisible by 3 , it must be removed by dividing n by prime number power ..
If count is not divisible by 3 , it must be removed by dividing n by prime number power ..
if n is a prime number.
Driver code"
Solution in Python:
assistant
#Here is code to minimum divisor of a number to make the number perfect cube and the other steps required.
 def findMinNumber ( n ) :
	count = 0 ;
	ans = 1 ;
	while ( n % 2 == 0 ) :
		count += 1 ;
		n /= 2 ;
	if ( count % 3 != 0 ) :
		ans *= pow ( 2 , ( count % 3 ) ) ;
	for i in range ( 3 , int ( pow ( n , 1 / 2 ) ) , 2 ) :
		count = 0 ;
		while ( n % i == 0 ) :
			count += 1 ;
			n /= i ;
		if ( count % 3 != 0 ) :
			ans *= pow ( i , ( count % 3 ) ) ;
	if ( n > 2 ) :
		ans *= n ;
	return ans ;
if __name__ == ' _ _ main _ _ ' :
	n = 128 ;
	print ( findMinNumber ( n ) ) ;