I'd like to calculate an infinite sum
Like this: Sum from k=1 to infinite of (0.9^k) * r + k+1 //or any other
My first idea was something like this:
def infiniteCalc(r):
result = r
for k in range(10000000):
result += 0.9**k + r + k +1 +1 //k is starting at 0, so another +1
return result
Another idea was to check, if the result changes within an iteration, but I'm not sure if this is helpful.
Another idea was to use something like limit, but I don't know if python provides a function for that (and if, is this really my solution?)