Skip to main content

Section 4.1 Introduction to Sequences

A sequence is an ordered list of objects. Sequences are patterns of numbers.

Definition 4.1.1. Sequences.

Definition 4.1.2.

Broadly, a sequence is an ordered list of objects.

Typically, a sequence is represented by a set of elements listed in a row,

\begin{equation*} a_1, a_2, a_3, a_4, \dots, a_n \end{equation*}

Each element of a sequence is called a term. Then, the terms of the sequence are denoted by \(a_k\text{,}\) read as “a sub k”. The integer \(k\) is called a subscript, or index, because it indicates the position of each term in the list. The first term is \(a_1\text{,}\) the second term is \(a_2\text{,}\) the third term is \(a_3\text{,}\) and so on. The tenotation \(a_n\) represents the \(n\)th term, or the general term.

A sequence can be thought of more formally as a function \(f\text{,}\) whose domain is all the integers between two given integers, or all the integers greater than or equal to a given integer. Then,

\begin{align*} f(1) \amp = a_1\\ f(2) \amp = a_2\\ f(3) \amp = a_3\\ \amp \vdots\\ f(n) \amp = a_n \end{align*}

We can also consider sequences which continue indefinitely, called infinite sequences (in contrast, sequences with finitely many terms are called finite sequences). Infinite sequences are commonly studied in calculus.

Also, a sequence can be started at an index other than 1, sometimes 0 or 2. More generally,

\begin{equation*} a_m, a_{m+1}, a_{m+2}, \dots, a_n \end{equation*}

where \(n \geq m\text{.}\)

Subsection 4.1.1 Specifying a Sequence

There are multiple ways to define a sequence.

  • List the first few terms, followed by an ellipsis \(\dots\) (where \(\dots\) means “and so on”).

The sequence,

\begin{equation*} \set{a_n} = \set{1, 2, 3, 4, 5, \dots} \end{equation*}

is the sequence of natural numbers. It continues, 6, 7, 8, and so on.

This only works if the pattern is obvious from the first few terms.

  • Provide a formula for the general term. Give an explicit formula for the general term \(a_n\) as a function of \(n\text{.}\) In other words, write \(a_n = f(n)\text{,}\) where \(f(n)\) is some expression involving \(n\text{.}\)

The sequence of natural numbers can be written as \(a_n = n\) for all \(n \in \mathbb{N}\text{.}\)

The sequence,

\begin{equation*} \set{a_n} = \set{2, 4, 6, 8, \dots} \end{equation*}

is the sequence of even natural numbers, given by \(a_n = 2n\) for all \(n \in \mathbb{N}\text{.}\)

For example, \(a_n = \sqrt{n}\text{.}\)

For example, the sequence \(a_n = (-1)^{n+1}\text{,}\) or,

\begin{equation*} \set{a_n} = \set{1, -1, 1, -1, \dots} \end{equation*}

Subsection 4.1.2 Sequences in Python

Given the formula for the general term of a sequence, Python can be used to compute a partial list of values of the sequence.

            seq = [a(i) for i in range(1,n+1)]
        

This syntax means to create a list seq by evaluating the function a(i) for the integers in the range from \(i = 1\) to \(i = n\text{,}\) and adding each result to the list. Then, define the function a(i) based on the formula for the particular sequence. This syntax is called a list comprehension.

More generally, the sequence can start at an integer \(m\) other than 1,

            seq = [a(i) for i in range(m,n+1)]
        

The above syntax is equivalent to the more lengthy syntax,

            seq = []
            for i in range(1,n+1):
                seq.append(a(i))
        

Subsection 4.1.3 Infinite Sequences

Definition 4.1.8.

An infinite sequence (or simply sequence) is an ordered collection of numbers with infinitely many elements.

An arbitrary infinite sequence can be represented by the notation,

  • \(\set{a_n}_{n=1}^{\infty}\) i.e. the set of all \(a_n\) where \(n = 1, 2, 3, \dots\) “up to infinity”.

  • \(\set{a_n}_{n \in \mathbb{N}}\text{,}\) i.e. \(n \in \mathbb{N}\) is any natural number.

  • Or, simply by \(\set{a_n}\text{,}\) especially if the starting index is arbitrary.

An infinite sequence can be thought of as a function whose domain is all natural numbers, or the set of all positive integers greater than or equal to some integer.