I am implementing a recursive code to sum of the sequence: x + x^2 / 2 + x^3 / 3... + x^n / n, i thought a setting combining two recursive functions, but is returning approximate values for n < 4, is very high for n >= 4, obviously is incorrect, but it was the best definition that i thought. Code Below:
def pot(x, n):
if n == 0: return 1
else:
return x * pot(x, n - 1)
def Sum_Seq (x, n):
if n == 1: return x
else:
return x + Sum_Seq(pot(x, n - 1), n - 1) / (n - 1)