You are viewing a single comment's thread. Return to all comments →
Simple Python 3 Solution
def powerSum(X, N): return recursivePowerSum(1, X, N) def recursivePowerSum(i, X, N): if X == 0: return 1 elif X >= pow(i, N): result = 0 result += recursivePowerSum(i+1, X, N) result += recursivePowerSum(i+1, X - pow(i, N), N) return result
Seems like cookies are disabled on this browser, please enable them to open this website
The Power Sum
You are viewing a single comment's thread. Return to all comments →
Simple Python 3 Solution