title: How to implement a summation from 1 to infinite in python
body: <p>I'd like to calculate an infinite sum</p>
  
  <p>Like this: Sum from k=1 to infinite of (0.9^k) * r + k+1 //or any other</p>
  
  <p>My first idea was something like this:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Another idea was to check, if the result changes within an iteration, but I'm not sure if this is helpful.</p>
  
  <p>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?)</p>