title: Numpy: calculate based on previous element?
body: <p>Say that I have array <code>x</code> and <code>y</code>:</p>
  
  <pre><code>x = numpy.array([1,2,3,4,5,6,7,8,9,10])  # actual content is the a result of another calculation step
  </code></pre>
  
  <p>There's a formula for <code>y</code>, and each element is based on the previous element, let <code>i</code> denote the index of <code>y</code>, each element is:</p>
  
  <pre><code>y[i] = y[i-1] * 2 + x[i]
  </code></pre>
  
  <p>When calculating the first element, let <code>y[i-1] = 50</code>. In other words, <code>y</code> should be:</p>
  
  <pre><code>[101, 204, 411, 826, 1657, 3320, 6647, 13302, 26613, 53236]
  </code></pre>
  
  <p>How do I calculate <code>y</code> with numpy?</p>