Give an arithmetic sequence in recursive, iterative and explicit form, and say what each is good for.
Recursive defines a term from its predecessor, iterative accumulates the step $d$ from the start, explicit is a closed formula in $n$ — same sequence, three descriptions with very different costs.
For the sequence $5, 13, 21, 29, \dots$ (start $c = 5$, common difference $d = 8$):
| Form | Definition | For this sequence |
|---|---|---|
| Recursive | $a_n = a_{n-1} + d$, $a_1 = c$ | $a_1 = 5$, $a_n = a_{n-1} + 8$ |
| Iterative | $a_n = a_1 + \sum_{i=2}^{n} d$ | $5 + \sum_{i=2}^{n} 8$ |
| Explicit | $a_n = f(n)$ | $5 + 8(n-1) = 8n - 3$ |
The same three-way split applies to the series (the running total $s_n = \sum_{i=1}^{n} a_i$), where the explicit form comes from the general formula $s_n = \frac{n(a_1 + a_n)}{2}$ — for this sequence $s_n = \frac{n(5 + 8n - 3)}{2} = 4n^2 + n$.
Why this is complexity analysis in miniature. The recursive and iterative forms need $n$ steps to reach the $n$-th term; the explicit form needs a handful of arithmetic operations regardless of $n$ — $O(n)$ against $O(1)$. And the explicit form is also what reveals the growth class at a glance: $8n - 3$ is visibly linear, $4n^2 + n$ visibly quadratic, whereas neither is apparent from the recurrence. Deriving the closed form is how a recurrence gets turned into an O-classification.
Go deeper:
Arithmetic progression — the nth-term and sum formulas derived, including the reversal trick.