A sequence is a function with an ordered index set. This viewpoint distinguishes a list of values from a set, explains recursive definitions, and fixes which terms a partial sum contains. Read Functions and Mappings first; techniques for manipulating sums are developed separately in Finite Sums and Summation Techniques.

This chapter moves from individual terms to partial sums and series. It introduces the meaning of convergence; convergence tests and a systematic treatment of infinite summation belong to Infinite Series in calculus.

Indexing is part of the definition

DefinitionDefinition and notation for a sequence

An infinite sequence in a set XX is a function x:N→Xx:\mathbb N\to X, with x(n)x(n) written xnx_n. Here N={0,1,2,…}\mathbb N=\{0,1,2,\ldots\}. The entire sequence is denoted by

{xn}n=0∞=(x0,x1,x2,…).\{x_n\}_{n=0}^{\infty}=(x_0,x_1,x_2,\ldots).

When the terms are numbers, this is a numerical sequence; for example, X=RX=\mathbb R gives a real sequence. A single xnx_n denotes the term at index nn, whereas {xn}n=0∞\{x_n\}_{n=0}^{\infty} denotes the whole sequence.

The braces notation {xn}n=0∞\{x_n\}_{n=0}^{\infty} is common; the parentheses notation (xn)n=0∞(x_n)_{n=0}^{\infty} denotes the same sequence. Braces in this sequence notation do not turn it into an ordinary set that ignores order and repetition. For example, the sequence (1,1,2)(1,1,2) has three terms, while its set of values {1,2}\{1,2\} has two elements. The index range and context distinguish these uses.

The subscript n=0n=0 outside the braces specifies the starting index. The superscript ∞\infty means that the indices continue indefinitely; it is neither a power nor a final term indexed by infinity. This notation lists terms and does not add them. Letters such as ana_n may be used instead, and {xn}\{x_n\} or (xn)(x_n) may abbreviate the sequence when the index range is understood.

Starting at 11 is equally legitimate, in which case we write

{xn}n=1∞=(x1,x2,x3,…).\{x_n\}_{n=1}^{\infty}=(x_1,x_2,x_3,\ldots).

A finite sequence of length N≥1N\ge1 is a function on {0,…,N−1}\{0,\ldots,N-1\}, denoted by

{xn}n=0N−1=(x0,x1,…,xN−1).\{x_n\}_{n=0}^{N-1}=(x_0,x_1,\ldots,x_{N-1}).

There are NN terms, with final index N−1N-1. When N=0N=0, the domain is empty and we obtain the empty sequence.

Order and repetition matter. The sequences (2,2,5)(2,2,5) and (2,5,2)(2,5,2) differ, although both have the same set of values {2,5}\{2,5\}. A real sequence takes values in R\mathbb R, but sequences may also consist of vectors, functions, symbols, or other objects. A mathematical definition does not necessarily supply an efficient algorithm for computing arbitrary terms.

For example, with indices i=1,…,10i=1,\ldots,10, let aia_i be the least prime divisor of i+1i+1. The sequence is (2,3,2,5,2,7,2,3,2,11)(2,3,2,5,2,7,2,3,2,11). Each value is defined because i+1>1i+1>1. Giving the index range prevents the mistaken request for a prime divisor of 11.

Separate the index set, codomain, and image

A sequence is a function, so three sets must be distinguished: its indices, its possible values, and its values that actually occur. Naive Set Theory defines finite, countably infinite, and uncountable sets; here those terms must be attached to the right object.

All three examples below have the uncountable codomain R\mathbb R, but their images are much smaller.

SequenceIndex setImage
(2,2,5)(2,2,5){0,1,2}\{0,1,2\}, finite{2,5}\{2,5\}, finite
xn=7x_n=7 for n≥0n\ge0N\mathbb N, countably infinite{7}\{7\}, finite
xn=2nx_n=2n for n≥0n\ge0N\mathbb N, countably infiniteNonnegative even integers, countably infinite

An infinite sequence has infinitely many positions, not necessarily infinitely many distinct values. Its image is always at most countable: assign each value its first occurrence index to obtain an injection into N\mathbb N. Thus an ordinary real sequence cannot enumerate all real numbers. The uncountability proof for R\mathbb R appears in Number Systems, Algorithms, and Recursion.

More generally, a function x:I→Xx:I\to X is an indexed family, written (xi)i∈I(x_i)_{i\in I}. The set II may be uncountable; for example, xt=tx_t=t for t∈Rt\in\mathbb R. Such a family is not an ordinary sequence indexed by natural numbers. An ordinal-indexed family is called a transfinite sequence; ordinal indices may be countable or uncountable. This extension belongs to later set theory, not to the arithmetic and geometric sequences below.

One further distinction matters: the set of all infinite binary sequences is uncountable, although each individual binary sequence has only countably many positions and at most two values. The exploration at the end makes this precise.

Explicit and recursive descriptions

An explicit formula such as an=2n+4a_n=2n+4 specifies the value directly from the index. A recurrence such as an+1=an+2a_{n+1}=a_n+2, together with a0=4a_0=4, defines the same sequence by relating neighboring terms. Both the recurrence and its starting data are needed.

The equation an+1=2an−an−1a_{n+1}=2a_n-a_{n-1} alone does not specify a unique sequence. Supplying a0=4,a1=6a_0=4,a_1=6 gives an=2n+4a_n=2n+4, as proved in Mathematical Induction. Different initial values generally give different solutions. For more involved recursive objects and termination arguments, continue with Number Systems, Algorithms, and Recursion.

The term “closed form” is relative to which operations and functions are admitted. A finite sum is not an infinite expression merely because it has a variable upper bound. It may require more arithmetic as the bound increases, but that is a computational issue distinct from whether it has finitely many terms.

Arithmetic sequences

DefinitionConstant first difference

An arithmetic sequence satisfies an+1−an=da_{n+1}-a_n=d for a fixed constant dd. With initial term a0a_0, its explicit formula is an=a0+nda_n=a_0+nd for n≥0n\ge0.

The formula follows by induction: it holds at 00, and adding dd changes a0+nda_0+nd into a0+(n+1)da_0+(n+1)d. The word is arithmetic, referring to a constant difference, not “algorithmic,” which would concern computational procedures.

Let SNS_N be the sum of the first NN terms, from a0a_0 through aN−1a_{N-1}. Writing the sum in forward and reverse order pairs each term with one whose index sums to N−1N-1. Every pair has value 2a0+(N−1)d2a_0+(N-1)d, so

SN=N2(2a0+(N−1)d).S_N=\frac N2\bigl(2a_0+(N-1)d\bigr).

There are NN such pairs in the sum of the two copies; dividing by 22 corrects the duplication. At N=0N=0, the expression is zero, agreeing with the empty sum. If terms instead start at a1a_1, the corresponding formula uses a1a_1 and the last index NN.

Geometric sequences

DefinitionConstant multiplicative step

A geometric sequence satisfies an+1=rana_{n+1}=ra_n for fixed rr, with explicit form an=a0rna_n=a_0r^n. The zeroth power in this formula is the constant 11, including the polynomial convention when r=0r=0.

The recurrence definition remains meaningful when some terms are zero; defining the sequence solely through ratios an+1/ana_{n+1}/a_n would exclude those cases. For the first NN terms, subtract rSNrS_N from SNS_N to cancel the interior terms:

(1−r)SN=a0(1−rN).(1-r)S_N=a_0(1-r^N).

Consequently,

SN={a01−rN1−r,r≠1,Na0,r=1.S_N= \begin{cases} \displaystyle a_0\frac{1-r^N}{1-r},&r\ne1,\\ Na_0,&r=1. \end{cases}

The condition r≠1r\ne1 comes from division, not from the definition of a geometric sequence. The finite identity holds even for ∣r∣≥1|r|\ge1. Passing to an infinite sum is a separate limit question; the familiar limit a0/(1−r)a_0/(1-r) applies when ∣r∣<1|r|<1. Convergence is developed in Infinite Series.

Terms, partial sums, and infinite series

For a sequence starting at zero, define

SN=∑n=0N−1an,S0=0.S_N=\sum_{n=0}^{N-1}a_n, \qquad S_0=0.

The original sequence lists terms; (SN)(S_N) lists cumulative sums. The relation aN=SN+1−SNa_N=S_{N+1}-S_N recovers a term. An infinite series is studied through whether its sequence of partial sums converges; merely writing infinitely many terms does not assign a finite sum.

For example, an=1a_n=1 gives SN=NS_N=N, so the partial sums do not approach a finite real number. In contrast, an=2−na_n=2^{-n} has SN=2(1−2−N)S_N=2(1-2^{-N}), which approaches 22. These examples distinguish a perfectly well-defined infinite sequence from convergence of its series.

Indicator sequences connect sets to sums

Let a finite universe be listed without repetition as U={x1,…,xN}U=\{x_1,\ldots,x_N\}. A subset A⊆UA\subseteq U has indicator sequence

χA(i)={1,xi∈A,0,xi∉A.\chi_A(i)= \begin{cases} 1,&x_i\in A,\\ 0,&x_i\notin A. \end{cases}

The subset itself has no order, but its indicator sequence depends on the chosen listing. For U=(1,3,5,7,9)U=(1,3,5,7,9) in this order, the prime subset has sequence (0,1,1,1,0)(0,1,1,1,0), while the multiples-of-three subset has (0,1,0,0,1)(0,1,0,0,1). Note that 11 is not prime.

For each index,

χA∩B(i)=χA(i)χB(i),\chi_{A\cap B}(i)=\chi_A(i)\chi_B(i), χA∪B(i)=χA(i)+χB(i)−χA(i)χB(i),\chi_{A\cup B}(i)=\chi_A(i)+\chi_B(i)-\chi_A(i)\chi_B(i),

and χU∖A(i)=1−χA(i)\chi_{U\setminus A}(i)=1-\chi_A(i). Also, A⊆BA\subseteq B exactly when χA(i)≤χB(i)\chi_A(i)\le\chi_B(i) at every index. Counting becomes

∣A∣=∑i=1NχA(i).|A|=\sum_{i=1}^{N}\chi_A(i).

Each formula can be checked on the four possible pairs of indicator values. This is a concrete connection between sets, Boolean values, and finite sums.

Exercises

ExerciseKeep length and final index separate

A sequence has an=3+2na_n=3+2n for n≥0n\ge0. Find a4a_4 and the sum of its first five terms. How many terms occur from index 00 through index NN?

Show solution
Solution

a4=11a_4=11. The first five terms are 3,5,7,9,113,5,7,9,11, with sum 3535. Indices 00 through NN include N+1N+1 terms, whereas the first NN terms end at index N−1N-1.

ExerciseCheck the exceptional ratio

For an=4rna_n=4r^n, find the sum of the first three terms for r=1,0,−1r=1,0,-1. Check against the finite geometric-sum formula.

Show solution
Solution

The respective terms are (4,4,4)(4,4,4), (4,0,0)(4,0,0), and (4,−4,4)(4,-4,4), with sums 12,4,412,4,4. Use the separate r=1r=1 branch for the first case. The other two follow from 4(1−r3)/(1−r)4(1-r^3)/(1-r). No infinite-series convergence assumption is involved.

ExerciseA quadratic partial sum and its first term

Here terms start at a1a_1. Suppose α≠0\alpha\ne0 and, for every n≥1n\ge1,

Sn=∑j=1naj=αn2+βn+γ.S_n=\sum_{j=1}^{n}a_j=\alpha n^2+\beta n+\gamma.

Find ana_n. When is the entire sequence arithmetic?

Show solution
Solution

The first term is a1=S1=α+β+γa_1=S_1=\alpha+\beta+\gamma. For n≥2n\ge2,

an=Sn−Sn−1=α(2n−1)+β.a_n=S_n-S_{n-1}=\alpha(2n-1)+\beta.

From a2a_2 onward the common difference is 2α2\alpha, but a2−a1=2α−γa_2-a_1=2\alpha-\gamma. Thus the entire sequence is arithmetic exactly when γ=0\gamma=0. The given formula was stated only for n≥1n\ge1, so substituting n=0n=0 into it and assuming S0=γS_0=\gamma would be invalid: the actual empty sum is zero.

ExerciseReconstruct a subset from its indicator

For the ordered listing U=(a,b,c,d)U=(a,b,c,d), let χA=(1,0,1,0)\chi_A=(1,0,1,0) and χB=(0,1,1,0)\chi_B=(0,1,1,0). Find A∩BA\cap B, A∪BA\cup B, and their sizes.

Show solution
Solution

The intersection indicator is (0,0,1,0)(0,0,1,0), so A∩B={c}A\cap B=\{c\} has size one. The union indicator is (1,1,1,0)(1,1,1,0), giving {a,b,c}\{a,b,c\} of size three. Summing each indicator counts its selected elements.

ExerciseSupply enough initial data

Explain why an+1=2an−an−1a_{n+1}=2a_n-a_{n-1} for n≥1n\ge1, together with a0=4a_0=4, does not determine a unique sequence.

Show solution
Solution

Choosing a1=6a_1=6 gives an=4+2na_n=4+2n, while choosing a1=4a_1=4 gives the constant sequence an=4a_n=4. Both satisfy the stated recurrence and the one given initial value. A second starting value is needed to distinguish them.

ExerciseInfinite positions need not give infinitely many values

Compare the real sequences xn=(−1)nx_n=(-1)^n and yn=ny_n=n, both indexed by n∈Nn\in\mathbb N. State the cardinalities of their index sets, codomains, and images.

Show solution
Solution

Both index sets are countably infinite, and both declared codomains R\mathbb R are uncountable. The image of xx is the finite set {−1,1}\{-1,1\}; the image of yy is N\mathbb N, countably infinite. Neither is an exhaustive listing of its codomain.

ExerciseFinite binary strings versus infinite binary sequences

Why is the set of all finite binary strings countable, while the set of all infinite binary sequences is uncountable? Include the empty string in the finite case.

Discussion guide
Solution

List finite strings by length and then lexicographically within each length: the empty string, 00, 11, 0000, 0101, 1010, 1111, and so on. There are 2m2^m strings of each length mm, so any fixed string appears after finitely many earlier strings. This gives a countably infinite list.

For infinite sequences, suppose a list contains rows s(0),s(1),…s^{(0)},s^{(1)},\ldots, where sn(k)∈{0,1}s^{(k)}_n\in\{0,1\}. Define dn=1−sn(n)d_n=1-s^{(n)}_n. The sequence dd differs from row kk at position kk, so no row equals dd. Every attempted list fails. This is the indicator-sequence version of the power-set diagonal argument from Naive Set Theory: each subset of N\mathbb N corresponds to one infinite binary membership sequence.