Lesson 5 of 15
Infinite Series
Infinite Series
An infinite series is the sum of the terms of a sequence:
Partial Sums
The (N)-th partial sum is:
A series converges if the sequence of partial sums ((S_N)) converges. The limit is the sum of the series.
Geometric Series
The geometric series (\sum_{n=0}^{\infty} r^n) converges to (\frac{1}{1-r}) when (|r| < 1).
For example, (\sum_{n=0}^{\infty} (1/2)^n = 2).
Harmonic Series
The harmonic series (\sum_{n=1}^{\infty} 1/n) diverges -- the partial sums grow without bound, even though the terms go to zero.
The Divergence Test
If (\lim_{n \to \infty} a_n \ne 0), then (\sum a_n) diverges. (The converse is false -- the harmonic series is a counterexample.)
Your Task
Implement:
partial_sum(f, N)-- computes (\sum_{n=1}^{N} f(n))partial_sums(f, N)-- returns a list ([S_1, S_2, \ldots, S_N])
Pyodide loading...
Loading...
Click "Run" to execute your code.