Skip to content
AI360Xpert
Beta

Sequences and Series

A sequence lists numbers in order while a series adds them up, so one names the steps and the other names the running total.

Bars show terms 2, 4, 8, 16 while the climbing line tracks partial sums 2, 6, 14, 30, separating listing from accumulating
Bars show terms 2, 4, 8, 16 while the climbing line tracks partial sums 2, 6, 14, 30, separating listing from accumulating

Why Does This Exist?

Training logs, loss curves, and iterative algorithms all produce ordered numbers, and the questions asked of them split two ways: "what is the next value?" versus "what do they add up to?" Sequences serve the first, series the second. Gradient descent iterates a sequence of parameters; total training cost sums a series of per-step costs; infinite series define the functions models compute.

Blurring the two corrupts both: treating a running total as the next term double-counts, and treating terms as totals misses accumulation. This page fixes the distinction with one shared example carried through every section. Convergence questions continue in series and convergence; the famous families are in arithmetic and geometric sequences.

The one idea you need first

A sequence a1,a2,a3,…a_1, a_2, a_3, \ldots is an ordered list where position matters: ana_n names the nn-th term. A series ∑an\sum a_n is the sum of a sequence's terms. The NN-th partial sum SN=a1+⋯+aNS_N = a_1 + \cdots + a_N is the series stopped at NN: finite, computable, and the bridge between listing and totaling.

Think of It Like This

Daily deposits versus the bank balance

Each morning you deposit some cash: Monday 2, Tuesday 4, Wednesday 8, Thursday 16. The deposit slips are the sequence: individual events in order. The bank balance after each day is the series of partial sums: 2, 6, 14, 30. Ask "what arrived Thursday?" and you read a slip; ask "what have we saved?" and you read the balance.

Confusing them buys trouble: handing someone Thursday's slip when they asked for total savings understates by 14. The analogy stops at infinity: bank balances stop at today, while series ask what the balance approaches if deposits continue forever.

How It Actually Works

Given terms ana_n, the two objects and their notations are:

sequence: (an)=a1,a2,…,SN=∑n=1Nan,series: ∑n=1∞an=lim⁡N→∞SN\text{sequence: } (a_n) = a_1, a_2, \ldots, \qquad S_N = \sum_{n=1}^{N} a_n, \qquad \text{series: } \sum_{n=1}^{\infty} a_n = \lim_{N \to \infty} S_N

In plain words: the sequence parents the terms in order; SNS_N (capital S) adds the first NN of them with the ∑\sum (sigma) notation naming start, end, and rule; the infinite series is the limit of those running totals if they settle. The sequence asks "what is a4a_4?"; the series asks "where do the totals head?" Different questions, different answers, same raw material.

Finite sums need no limits: 2+4+8+16=302 + 4 + 8 + 16 = 30 is exact arithmetic. Infinity enters only when asking whether endless totals converge or escape, which belongs to the convergence page.

Worked example

Take an=2na_n = 2^n for n=1,2,3,4n = 1, 2, 3, 4: terms 2,4,8,162, 4, 8, 16.

  • Partial sums: S1=2S_1 = 2; S2=2+4=6S_2 = 2 + 4 = 6; S3=6+8=14S_3 = 6 + 8 = 14; S4=14+16=30S_4 = 14 + 16 = 30.
  • Next step predicts: a5=32a_5 = 32, so S5=62S_5 = 62. Terms double, totals nearly double (minus 2).
  • Closed form check: SN=2N+1−2S_N = 2^{N+1} - 2. At N=4N = 4: 32−2=3032 - 2 = 30. Matches.

The sequence grows by doubling; the series grows alongside, always 22 behind the next term. One rule, two views, zero contradiction.

Code

Build terms and totals side by side and confirm the closed form.

import numpy as np
terms = 2 ** np.arange(1, 5)  # [2, 4, 8, 16]totals = np.cumsum(terms)     # running sumsprint(terms)                  # -> [ 2  4  8 16]print(totals)                 # -> [ 2  6 14 30]print(2 ** 5 - 2)             # -> 30

Terms, running totals, and formula agree at 30: listing and accumulating reconciled in five lines.

Watch Out For

Plotting terms where totals belong

A loss "curve" that plots per-batch loss looks spiky and alarming; the cumulative training cost tells the budget story. Teams have restarted healthy runs after reading term noise as total divergence.

Label which object every chart shows: per-step value or running accumulation. If a trend looks wrong, check whether the axes show slips or balances before touching hyperparameters.

Assuming totals inherit term behavior

Terms shrinking to zero does not guarantee totals settle: the harmonic terms 1/n1/n vanish while their totals grow without bound. "Each step is tiny" never implies "the sum is small."

Test totals directly for the question asked. If convergence matters, run the convergence checks rather than eyeballing term sizes.

The Quick Version

  • Sequences list terms in order; series add them into running totals.
  • Partial sum SNS_N is the series stopped at NN: finite and exact.
  • Terms 2,4,8,162, 4, 8, 16 give totals 2,6,14,302, 6, 14, 30, with SN=2N+1−2S_N = 2^{N+1} - 2.
  • Infinite series ask where totals head, which needs convergence tools.
  • Chart labels must say per-step or cumulative: slips versus balances.
  • Shrinking terms never guarantee settling totals; check the sums themselves.