## The number e

The number e is given by the infinite sum
1 + 1/1! + 1/2! + 1/3! + 1/4! + ... .
Here 1! = 1, 2! = (2)(1), 3! = (3)(2)(1), etc.
The infinite sum is approximated by partial sums:

S_{0} = 1

S_{1} = 1 + 1/1! = 2

S_{2} = 1 + 1/1! + 1/2! = 2.5

S_{3} = 1 + 1/1! + 1/2! + 1/3! = 2.66666....

The more terms in the partial sum, the better the approximation.
Thus e is the limit of the sequence of numbers
S_{0}, S_{1}, S_{2}, S_{3}, ....

To compute the n-th partial sum of the series for e,
use the form below. Use it to determine a value of
e accurate to 10 decimal places.

The n-th partial sum is computed by the Javascript function
`sum`

:

function sum(n) {
var s = 1, f = 1;
for(i=1; i <= n; i++) {
f *= i;
s += 1.0/f;
}
return s;
}