the power sum
def count_expressions(x, n, vals):
s = sum(v**n for v in vals)
if s == x:
return 1
else:
v = (if vals.empty() then 1 else (last element of vals) + 1)
answer = 0
while s + v**n <= x:
answer += count_expressions(x, n, vals + [v])
v++
return answer