human
Find ways an Integer can be expressed as sum of n | Python 3 program to find number of ways to express a number as sum of n - th powers of numbers ..
Wrapper over checkRecursive ( ).
Driver Code"
How can the above be solved in Python?
 Can you provide a code to find ways an Integer can be expressed as sum of n and the other steps required?
assistant
#Here is code to find ways an Integer can be expressed as sum of n and the other steps required.
 def checkRecursive ( num , rem_num , next_int , n , ans = 0 ) :
	if ( rem_num == 0 ) :
		ans += 1
	r = int ( num ** ( 1 / n ) )
	for i in range ( next_int + 1 , r + 1 ) :
		a = rem_num - int ( i ** n )
		if a >= 0 :
			ans += checkRecursive ( num , rem_num - int ( i ** n ) , i , n , 0 )
	return ans
def check ( x , n ) :
	return checkRecursive ( x , x , 0 , n )
if __name__ == ' _ _ main _ _ ' :
	print ( check ( 10 , 2 ) )