For a function p(0) = 10000, p(n) = p(n-1) + 0.02*p(n-1),
the code should be like this:
def p(n,v=10000):
if n == 0:
return v
else:
return p(n-1,1.02*v)
But if p(0) = 10000, p(n) = p(n-1) + 10**(n-1),
then how to write this tail recursion?