Sequence and Partial Sum Calculator — Theory
1. What is a sequence?
A sequence is an ordered list of numbers. The \(n\)-th term is usually written as \(a_n\).
\[
a_1,\ a_2,\ a_3,\ \ldots,\ a_n,\ \ldots
\]
2. Explicit definition
In an explicit sequence, the term is given directly as a formula in \(n\).
\[
a_n=f(n).
\]
For example,
\[
a_n=\frac{1}{n}.
\]
3. Recursive definition
In a recursive sequence, the first term is given, and later terms depend on previous terms.
\[
\begin{aligned}
a_{n_0}&=\text{starting value},\\
a_n&=g(n,a_{n-1}).
\end{aligned}
\]
For example,
\[
\begin{aligned}
a_0&=0,\\
a_n&=0.5a_{n-1}+1.
\end{aligned}
\]
4. Partial sums
A partial sum adds the first several terms of a sequence.
\[
S_N=\sum_{n=n_0}^{N}a_n.
\]
This creates an associated series:
\[
a_{n_0}+a_{n_0+1}+a_{n_0+2}+\cdots+a_N.
\]
5. Example: harmonic terms
For the sample input
\[
a_n=\frac{1}{n},
\qquad
1\le n\le 20,
\]
the partial sums are
\[
\begin{aligned}
S_{20}
&=\sum_{n=1}^{20}\frac{1}{n}\\
&=1+\frac12+\frac13+\cdots+\frac1{20}.
\end{aligned}
\]
The terms approach \(0\), but the harmonic series still diverges slowly.
6. Term behavior versus sum behavior
The behavior of \(a_n\) and the behavior of \(S_n\) are related but not identical.
A necessary condition for the infinite series to converge is
\[
\lim_{n\to\infty}a_n=0.
\]
However, this condition alone is not enough. For example,
\(a_n=\frac1n\) goes to \(0\), but \(\sum \frac1n\) diverges.
7. Geometric example
A geometric sequence has the form
\[
a_n=ar^{n-n_0}.
\]
If \(|r|<1\), the infinite geometric series converges:
\[
\sum_{n=n_0}^{\infty}ar^{n-n_0}
=
\frac{a}{1-r}.
\]
8. Alternating example
An alternating sequence changes sign from term to term. A common example is
\[
a_n=\frac{(-1)^{n+1}}{n}.
\]
Its partial sums oscillate while approaching a limit.
9. What the graph shows
The graph shows two related objects:
\[
\begin{aligned}
a_n&=\text{individual terms},\\
S_n&=\text{running partial sums}.
\end{aligned}
\]
If the partial-sum graph appears to flatten, the series may be approaching a finite value.
If it continues growing or oscillating without settling, more analysis is needed.
10. Why a finite table is not a proof
The calculator computes a finite number of terms. This is useful for exploration, but it is not always a rigorous proof of convergence or divergence.
To prove convergence formally, one may need tools such as the comparison test, ratio test, root test, integral test, or alternating series test.
12. Common mistakes
- Confusing \(a_n\) and \(S_n\): \(a_n\) is one term, while \(S_n\) is a sum of terms.
- Assuming \(a_n\to0\) proves convergence: it does not. It is only necessary.
- Using recursive mode without an initial value: recursion needs a starting term.
- Using the wrong index: make sure \(n_0\) matches the formula.
- Reading too much from a short table: some divergent series grow very slowly.