**This is an old revision of the document!** ----
====== Math 445 lecture 10: more ''for'' ====== Another illustration of the use of ''for'' loops to compute a sum. Recall this classic formula for $\pi^2/6$ due to Euler: \begin{eqnarray*} \frac{\pi^2}{6} = 1 + \frac{1}{2^2} + \frac{1}{3^2} + \frac{1}{4^2} + \frac{1}{5^2} + \ldots \end{eqnarray*} Rewrite this with summation notation \begin{eqnarray*} \frac{\pi^2}{6} = \sum_{n=1}^{\infty} \frac{1}{n^2} \end{eqnarray*} The Nth partial sum $P_N$ of the infinite series is \begin{eqnarray*} P_N = \sum_{n=1}^{N} \frac{1}{n^2} \end{eqnarray*} Then $\pi^2/6 = \lim_{N \rightarrow \infty} P_N$.