I have this Python function:
def main(n,x):
g=0
for i in range(1,n):
g+=((-1)^i)*(x^(2*i+1))/(2*i+1)
return g
print main(3,2)
and the output is -6, when I think it should be 86/15. Where is my mistake? I want to find the n-value of x-(x^3)/3+(x^5)/5+...
1.range(1,n,2)?