title: index 100 is out of bounds for axis 0 with size 100
body: <p>I was trying to write a programme using python to compute the infinite series of </p>
  
  <blockquote>
    <p>1/1^2 + 1/2^2 + 1/3^2 +1/4^2 +.....</p>
  </blockquote>
  
  <p>my code is as follows:</p>
  
  <pre><code>n = 100
  x = np.zeros([n])
  x[0] = 0
  for i in range(n):
     x[i+1] = x[i] + 1/float((i+1)**2)
  print x[99]
  </code></pre>
  
  <p>when I tried to execute the code, it returned something as:</p>
  
  <blockquote>
    <p>IndexError: index 100 is out of bounds for axis 0 with size 100</p>
  </blockquote>
  
  <p>I would like to know what is wrong with the code. Thanks!:)</p>