human
Find ways an Integer can be expressed as sum of n | Function to calculate and return the power of any given number.
Function to check power representations recursively.
Initialize number of ways to express x as n - th powers of different natural numbers.
Calling power of ' i ' raised to 'n.
Recursively check all greater values of i.
If sum of powers is equal to x then increase the value of result ..
Return the final result.
Driver Code ."
Solution in Python:
assistant
#Here is code to find ways an Integer can be expressed as sum of n and the other steps required.
 def power ( num , n ) :
	if ( n == 0 ) :
		return 1
	elif ( n % 2 == 0 ) :
		return power ( num , n // 2 ) * power ( num , n // 2 )
	else :
		return num * power ( num , n // 2 ) * power ( num , n // 2 )
def checkRecursive ( x , n , curr_num = 1 , curr_sum = 0 ) :
	results = 0
'
	p = power ( curr_num , n )
	while ( p + curr_sum < x ) :
		results += checkRecursive ( x , n , curr_num + 1 , p + curr_sum )
		curr_num = curr_num + 1
		p = power ( curr_num , n )
	if ( p + curr_sum == x ) :
		results = results + 1
	return results
if __name__ == ' _ _ main _ _ ' :
	x = 10
	n = 2
	print ( checkRecursive ( x , n ) )