$\newcommand{\ds}{\displaystyle}$ $\newcommand{\Nn}{\mathbb{N}}$ $\newcommand{\Rr}{\mathbb{R}}$

Sequences¶

Sequences are ubiquitous in mathematics.

Let $S$ be a set. For us, a sequence of elements of $S$ (or an $S$ sequence, in short) is simply a function a subset $I$ of $\Nn$ to $S$.

Let $a \colon I \to S$ be a sequence. We say that $I$ is the index set of $a$.

We say that $a$ is a finite (resp. an infinite) sequence if $I$ is finite (resp. infinite).

We write $a_n$ (instead of $a(n)$) for the value of $a$ at $n$.

$a_n$ is called the $n$-th term of the sequence $a$.

The set $\{a_n \colon n \in I\}$, i.e. the range of $a$, is the set of terms of the sequence $a$.

And often write $(a_n)_I$ (or simply $(a_n)$, if $I$ is understood) for the sequence $a$.

Example. $((-1)^n)_{\Nn}$ denotes the sequence $n \mapsto (-1)^n$, i.e.

$1,-1,1,-1,\cdots $

It is an infinite sequence however its set of terms is the finite set $\{-1,1\}$.

As real-valued functions, we can add and multiply real sequences.

  • $(a_n) + (b_n) = (a_n+b_n)$
  • $(a_n)(b_n) = (a_nb_n)$

If we identify the constant sequence $n \mapsto r$. Then

$$r(a_n) = (ra_n)$$

Some Special Types of Sequences¶

There are many types of sequences, here we study the two simpliest types. They are represented by polynomial functions (see next set of notes as well) and exponential functions, respectively.

An arithmetic sequence is a sequence $(a_n)$ given by

$$ a_n = a + nd,\quad \text{for some $a$ and $d$}. $$

We call $a$ the initial term and $d$ the common difference if the sequence $(a+nd)$.

Note that $a_0 = a$.

Example. Choosing $a=0$ and $d=1$ gives the sequence of natural numbers $(n)$, i.e.

$$0,1,2,3,...$$

Example. Choosing $a=1$ and $d=2$ gives the sequence of odd numbers $(1+2n)$:

$$ 1,3,5,7 \ldots $$

Given a finite arithmetic sequence

$$ a_0, a_1, \ldots, a_N$$

Then $a_0=a$, $a_1=a+d$, $a_2 = a+2d, \ldots, a_N = a+dN$ for some $a$ and $d$.

Since $d = a_1 -a_0$ and $a_N -a_0 = dN$, so if $d \neq 0$,

then the length (i.e. the number of terms) of this arithmetic sequence is

$$ N+1 = \frac{a_N - a_0}{a_1-a_0} +1.$$

N.B. The length is $N+1$ since the first index is $0$.

Next we show how to find the sum of a finite arithmetic sequence.

The key observation is that

$$ a_{j} + a_{N-j} = a+jd + a+(N-j)d = 2a+Nd $$

Sum the two vertically,

$$ \begin{align*} S &= a_0 + a_1 + \cdots + a_N \\ S &= a_N + a_{N-1} + \cdots + a_0 \end{align*} $$

we get $2S = (a_0 + a_N) + (a_1+ a_{N-1}) + \cdots + (a_N + a_0)$.

$= (N+1)(a_0 +a_N)$.

Thus, the sum of this finite arithmetic sequence is

$$ S = \frac{(a_0+a_N)(N+1)}{2}. $$

It is (1st term + last term) x (number of terms)/2.

Compare this with the formula for the area of trapeziod.

Example

There are $n$ terms in $1,2,\ldots, n$ so the sum

$$1+2+ \cdots + n = \frac{n(n+1)}{2} = \binom{n+1}{2}. $$

It is called the $n$-th triangular number.

Example

Find the sum of the following finite arithmetic sequence

$$ -3, -1, \ldots, 21. $$

We need to know how many terms are there. As we have seen, it is given by (or you can simply count them).

$$ \frac{21 - (-3)}{-1-(-3)} + 1 = \frac{24}{2} + 1 = 13.$$

Therefore, the sum is $ \ds \frac{1}{2}(-3 + 21)(13) = 117.$

A geometric sequence is a sequence $(a_n)$ given by

$$ a_n = ar^n $$

for some nonzero $a$ and $r$.

We call $a=a_0$ the initial term and $r$ the common ratio of this geometric sequence.

Given a finite geomertic sequence

$$a_0, a_1, \ldots, a_N$$

we have $r = a_1/a_0$ and $|a_N/a_0| = |r|^N$. So its length can be expressed as

$$ N+1 = \log_{|r|} |a_N/a_0|+1 = \frac{\log|a_N| - \log|a_0|}{\log|a_1|-\log|a_0|}+1. $$

To find its sum $S$, first note that

$$ \begin{align*} S &= a + ar + \cdots +ar^N \\ rS &= \phantom{a} \phantom{a+} ar + \cdots +ar^N + ar^{N+1} \end{align*} $$

Thus, $(1-r)S = S-rS = a -ar^{N+1} = a(1-r^{N+1})$.

Therefore, if $r \neq 1$, then $$ S = \frac{a(1-r^{N+1})}{1-r}.$$

If $r=1$, then the sequence is just constantly $a$ and hence the sum is $(N+1)a$.

Example.

$$ 1+2+2^2 + \cdots + 2^N = \frac{1-2^{N+1}}{1-2} = 2^{N+1} -1.$$

Exercise. Find the sum $1+2+4+\cdots + 256$.

Note that if $|r| < 1$, then $|r|^{N+1} \to 0$ as $N \to \infty$.

Therefore, for $|r| < 1$,

$$a + ar + ar^2 + \cdots = \frac{a}{1-r}.$$

Example.

$$ 1+ \frac{1}{2} + \frac{1}{4} + \cdots = \frac{1}{1-1/2} = 2.$$