# Sequences

In simple words **sequence** is a list of numbers written in definite order: `a_1,a_2,...,a_n`. `a_1` is first term, `a_2` is second term, and, in general, `a_n` is n-th term. We deal with infinite sequences, so each term `a_n` will have a successor `a_(n+1)`.

Notice that for every positive integer n there is a corresponding number `a_n` and so a sequence can be defined as a function whose domain is the set of positive integers. But we usually write `a_n` instead of the function notation f(n) for the value of the function at the number n.

The sequence `{a_1,a_2,...,a_n}` is also denoted by `{a_n}` or `{a_n}_(n=1)^(oo)`.

If sequence is given by formula `a_n=f(n)` then we calculate `a_n` by calculating `f(n)`. For example, if `a_n=1/(n+1)` then `a_3=1/(3+1)=1/4`.

**Example 1.** Some sequences can be defined by giving a formula for the n-th term. In the following examples we give three descriptions of the sequence: one by using the preceding notation, another by using the defining formula, and a third by writing out the terms of the sequence. Notice that n doesn't have to start at 1.

- `{n/(n^2+1)}_(n=1)^(oo)`, `a_n=n/(n^2+1)`, `{1/2,2/5,3/10,4/17,...,n/(n^2+1),...}`
- `{(-1)^n2^n}`, `a_n=(-1)^n 2^n`, `{-2,4,-8,16,...,(-1)^n 2^n,...}`
- `{1/(sqrt(n-2))}_(n=3)^(oo)`, `a_n=1/sqrt(n-2),n>2`, `{1,1/sqrt(2),1/sqrt(3),1/2,...1/sqrt(n-2),...}`
- `{sin((pin)/4)}_(n=0)^(oo)`, `a_n=sin((pin)/4),n>=0`, `{0,1/sqrt(2),1,1/sqrt(2),0,...,sin((pin)/4),...}`

Note, that there are sequences that don't have a simple defining equation.

**Example 2.**

- Sequence `{p_n}` where `p_n` is population of USA as of January 1 in the year n.
- If `a_n` is n-th decimal digit of number `pi` then `{a_n}={1,4,1,5,9,2,6,5,...}`.
- The Fibonacci sequence `{f_n}` is defined recursively as `f_1=1,f_2=1`,`f_n=f_(n-1)+f_(n-2)`, `n>=3`. In other words, n-th member is sum of two previous. So, `{f_n}={1,1,2,3,5,8,13,21,34,55,...}`.

Now, consider the sequence `a_n=n/(n+1)`. Since `n/(n+1)=1-1/(n+1)` then `1-n/(n+1)=1/(n+1)`. We see that this difference can be made as small as we like by taking n sufficiently large. We indicate it by writing `lim_(n->oo)n/(n+1)=1`.

**Definition.** A sequence `{a_n}` has the **limit** L and we write `lim_(n->oo)a_n=L` or `a_n->L` as `L->oo` if we can make the terms `a_n` as close to L as we like by taking n sufficiently large. If `lim_(n->oo)a_n` exists, we say the sequence **converges** (or is **convergent**). Otherwise, we say the sequence **diverges** (or is **divergent**).

Notice that the following definition of the limit of a sequence is very similar to the definition of a limit of a function at infinity.

If you compare Definition with definition of a limit of a function at infinity you will see that the only difference between `lim_(x->oo)f(x)=L` and `lim_(n->oo)a_n=L` is that n is required to be an integer.

Thus, we have the following theorem.

**Theorem 1.** If `lim_(x->oo)f(x)=L` and `f(n)=a_n` when n is an integer, then `lim_(n->oo)a_n=L`.

In particular, since `lim_(x->oo)1/x^r=0` when `r>0`, we have that `lim_(n->oo)1/n^r=0` when `r>0`.

If `a_n` becomes large as `n` grows we use notation `lim_(n->oo)a_n=oo`. In this case sequence `{a_n}` is divergent, but in a special way. We say that `{a_n}` diverges to `oo`.

The Limits Laws also hold for the limits of sequences and their proof are similar.

**Limit Laws for Convergent Sequences**

- If `{a_n}` and `{b_n}` are convergent sequences and c is arbitrary constant then;
- `lim_(n->oo)(a_n+b_n)=lim_(n->oo)a_n+lim_(n->oo)b_n`
- `lim_(n->oo)(a_n-b_n)=lim_(n->oo)a_n-lim_(n->oo)b_n`
- `lim_(n->oo)c=c`
- `lim_(n->oo)ca_n=clim_(n->oo)a_n`
- `lim_(n->oo)(a_nb_n)=lim_(n->oo)a_n*lim_(n->oo)b_n`
- `lim_(n->oo)(a_n)/(b_n)=(lim_(n->oo)a_n)/(lim_(n->oo)b_n)` if `lim_(n->oo)b_n!=0`
- `lim_(n->oo)a_n^p=(lim_(n->oo)a_n)^p` if `p>0` and `a_n>0`

The Squeeze Theorem can also be adapted for sequences as follows:

**Squeeze Theorem for Sequences.** If `a_n<=b_n<=c_n` for `n>=n_0` and `lim_(n->oo)a_n=lim_(n->oo)c_n=L` then `lim_(n->oo)b_n=L`.

Another Useful theorem is consequence of Squeeze Theorem:

**Theorem 2.** If `lim_(n->oo)|a_n|=0` then `lim_(n->oo)a_n=0`.

Proof. Since `-|a_n|<=a_n<=|a_n|` and `lim_(n->oo)-|a_n|=lim_(n->oo)|a_n|=0` then by Squeeze Theorem `lim_(n->oo)a_n=0`.

**Example 3.** Find `lim_(n->oo)n/(n-1)`.

As with limits of functions we divide numerator and denominator by the highest power of n that occurs in the denominator and then use the Limit Laws:

`lim_(n->oo)1/(1-1/n)=(lim_(n->oo)1)/(lim_(n->oo)1-lim_(n->oo)1/n)=1/(1-0)=1`.

**Example 4.** Calculate `lim_(n->oo)(ln(n))/n`.

Notice that both numerator and denominator approach infinity as `n->oo`. We can't apply l'Hospital's Rule directly because it applies not to sequences but to functions of a real variable. However, we can apply l'Hospital's Rule to the related function `f(x)=(ln(x))/x` and obtain `lim_(x->oo)(ln(x))/x=lim_(x->oo)((ln(x))')/(x')=lim_(x->oo)(1/x)/1=lim_(x->oo)1/x=0`.

Therefore, by Theorem 1, `lim_(n->oo)(ln(n))/n=0`.

**Example 5.** Determine whether the sequence `a_n=(-1)^n` is convergent or divergent.

Let's write a couple of terms in sequence: `{-1,1,-1,1,-1,1,...}`.

Since the terms oscillate between 1 and -1 infinitely often, `a_n` does not approach any number. Thus, `lim_(n->oo)(-1)^n` does not exist; that is, the sequence is divergent.

**Example 6.** Evaluate `lim_(n->oo)((-1)^n)/n` if it is exists.

Since `lim_(n->oo)|((-1)^n)/n|=lim_(n->oo)1/n=0` then, by Theorem 2, `lim_(n->oo)((-1)^n)/n=0`.

**Example 7.** Discuss convergence of sequence `a_n=(n!)/n^n` where `n! =1*2*3*...*n`.

Both numerator and denominator approach infinity as `n->oo` but here we have no corresponding function for use with l'Hospital's Rule (x! is not defined when x is not an integer). However, we can rewrite n-th term as `a_n=(1*2*3*...*n)/(n*n*n*...*n)`.

Now, `a_n=1/n((2*3*...*n)/(n*n*...*n))<=1/n((n*n*...*n)/(n*n*...*n))=1/n`.

So, `0<a_n<=1/n` and since `lim_(n->oo)1/n=0` then by Squeeze Theorem `lim_(n->oo)a_n=0`.

**Example 8. **For what values of r is the sequence `{r^n}` convergent?

We know that `lim_(x->oo)a^x=oo` if a>1 and `lim_(x->oo)a^x=0` for 0<a<1. Therefore, putting a=r and using Theorem 1 we obtain that `lim_(n->oo)r^n={(0 if 0<a<1),(oo if a>1):}`.

If r=0 then `lim_(n->oo)0^n=0`.

If r=1 then `lim_(n->oo)1^n=1`.

If `-1<r<0` then `0<|r|<1`, so `lim_(n->oo)|r^n|=lim_(n->oo)|r|^n=0`, so ,by Theorem 2, `lim_(n->oo)r^n=0`.

If `r<=-1` then sequence `{r_n}` diverges as in Example 5.

**Fact.** The sequence `{r_n}` is convergent if `-1<r<=1` and divergent for all other values of r: `lim_(n->oo)r^n={(0 if -1<r<1),(1 if r=1):}`.