Sequences

A sequence is a function whose defining domain is the set of natural numbers. A sequence can be either infinite if its defining domain is the entire set of natural numbers, or finite if its defining domain is only a finite subset of the domain of natural numbers. Unless it is explicitly said to be finite, a sequence is assumed to be infinite.

Definition of a sequence

This chapter describes at least a little about the meaning of the definition of a sequence; it is not strictly necessary to know it; you can skip the entire chapter if you wish.

The introduction has already revealed that this is a function that takes the natural numbers as its defining domain. The domain of values can then be any set, but here we will assume a set of real numbers. What does this mean? The most visible change will be in the graph of the function, because it will not be a continuous line, as is often the case with ordinary functions, but there will only be scattered isolated points in the sequence.

For example, a sequence might be a series of numbers 1, 3, 5, 7, 9, 11, ... This is probably a fairly well-defined sequence and it would be clear to anyone how it proceeds. Since it is a function, then a table displaying this sequence would look like this:

$$\begin{eqnarray} 1&\rightarrow&1\\ 2&\rightarrow&3\\ 3&\rightarrow&5\\ 4&\rightarrow&7\\ &\ldots& \end{eqnarray}$$

So the numbers in the first column (the values from the definition range) indicate the order of that number in the sequence. For example, in our simple sequence, the number five is in the third position. Which is exactly what the table tells us. Number seven is in the fourth position in the sequence, number one is in the first position, and so on. This also implies that the defining domain of a finite sequence p should be some set of the form

$$D(p)=\left\{1, 2, 3, \ldots, n\right\},$$

so that it really is a sequence and no position is left out. For example, this set

$$D(p)=\left\{1{,}2,3{,}5,7\right\}$$

does not fit the definitional scope of the sequence because it is missing the fourth and sixth elements.

Thus, a sequence is expressed by saying that its elements can be arranged in some way, that every element of the sequence, except the first and last, has a predecessor and a successor. This is a huge difference from real functions, where no such thing applies. if we take the function f(x) = 2x, what value follows f(5/2)? We don't know, the result is a real number and real numbers have no successor.

The sequence notation

We already know that - simplistically - a sequence is a numbered sequence of numbers. Now how can we write the sequence. We usually name the sequence itself with a lowercase subscripted letter, for example ai.

The first way is to list all the values of the sequence. We have already encountered this in the previous chapter. The enumeration can be finite or infinite:

$$\begin{eqnarray} a_k&=&(1{,}2,3{,}4,5)\\ a_n&=&(2{,}4,6{,}8,10,\ldots) \end{eqnarray}$$

Note: I'm not sure what parentheses are commonly used for sequences; I haven't found a uniform convention. I probably wouldn't use compound parentheses because they denote sets for which order doesn't matter, whereas for sequences the order of the members matters.

The other possibility is the formula for the n-th member of a sequence. For example, the set an contained all even numbers. We could express this in a formula like this

$$a_n=2n.$$

The subscript n tells us how many times we are currently counting the tenth member of the sequence. So if we want to know the first element, then we want to know the element a1, if the seventh, then a7. We would then calculate the seventh element by substituting it into the prescription.

$$a_7=2\cdot7=14$$

This notation is convenient because it allows us to immediately compute any element of the sequence. Another possibility is to write it using a recurrent definition. The recurrent definition allows us to compute the next member if we know the current one. Or, if we know the element an, it allows us to compute the element an + 1.

If we want to specify the sequence recursively, we need to give two pieces of information: what element is first and the recipe for computing the (n + 1). element. If we wanted to specify the set of even natural numbers recursively, we could do it like this:

$$a_1=2;\quad a_{n+1}=a_n+2$$

Now how would we calculate? We know that a1 is equal to two. Now we put a one after n and thus calculate a2 by adding a two to a1. We get four, the second even number. And so on.

$$\begin{eqnarray} a_1&=&2\\ a_2&=&a_1+2\quad(=4)\\ a_3&=&a_2+2\quad(=6)\\ a_4&=&a_3+2\quad(=8)\\ &\ldots& \end{eqnarray}$$

Writing using a recurrent definition comes in handy when we need to generate some larger part of a sequence. On the other hand, it is not suitable when we want to compute a particular element, because to compute the 100th even number, we must first compute all 99 even numbers that precede the 100th even number.

The last option is to specify the sequence using a graph.

Just to clarify: a sequence does not necessarily have to have a simple prescription, it does not have to be a "reasonable" sequence of numbers. This series of numbers is also a sequence, even though it has no deeper meaning at first glance:

$$a_i=(-5, \frac73, \pi, \pi, \pi, 13, 10^6+54, \log_354, 0)$$

The graph of a sequence

Sequences have different graphs from ordinary real functions. Because they have the natural numbers as their defining domain, their graph is made up of isolated points.

Graph the sequence a_n=n

Graph the sequence a_n=1/n

An arithmetic sequence is a sequence of arithmetic numbers that is defined by its elements.

An arithmetic sequence is a simple sequence where there is a constant difference between the members of the sequence. For example, each successive element is greater by three or less by seventeen. The difference by how much the elements of the sequence differ is called the difference (denoted by d). In the first case, the difference would be three, in the second case minus seventeen, and in the case of a sequence of even numbers, the difference would be two. Thus, the formula for an arithmetic sequence could be written as follows:

$$a_{n+1}=a_n+d$$

The general formula for calculating the n-th member of an arithmetic sequence is then

$$a_n=a_1+(n-1)d.$$

So, for the example, we take the even numbers again, where the difference is two and the first even number is also two. Then, the second even number is obtained by adding two to the first. If we add two one more time, we get a third even number.

$$\begin{eqnarray} a_1&=&2\\ a_2&=&a_1+2\quad(=4)\\ a_3&=&a_2+2\quad(=6)\\ a_4&=&a_3+2\quad(=8)\\ &\ldots& \end{eqnarray}$$

If we wanted to calculate, for example, a seventh even number, we would add it to the general formula as follows:

$$a_n=a_1+(n-1)d\rightarrow a_7=2+(7-1)\cdot2=2+12=14$$

How do we find out if a given sequence is arithmetic? We subtract the formula for the n-th member from the formula for the (n + 1). member and if we get the difference, it is an arithmetic sequence. So, for example, let's have a sequence

$$a_n=2n+7.$$

Is this sequence arithmetic? We start by expressing the (n + 1). term:

$$a_{n+1}=2(n+1)+7.$$

Now we subtract these two expressions from each other:

$$\begin{eqnarray} d&=&(2(n+1)+7)-(2n+7)\\ d&=&2n+2+7-2n-7\\ d&=&2n-2n+7-7+2\\ d&=&2 \end{eqnarray}$$

We can see that after subtraction, we have d = 2, so it is an arithmetic sequence with a difference of two.

The sum of the terms of the arithmetic sequence

We often need to find the sum of the first few terms of an arithmetic sequence. How would we do this? Intuitively, something like this. We'll stick to even numbers. What is the sum of the first three even numbers? That is, the numbers 2, 4 and 6. We could add them up one by one, of course, but we don't want that, we want a formula.

We'll modify the sequence like this, add two to the first element and subtract two from the last. We get 4, 4, 4. We see that we have three equal numbers, so we just multiply four by the number of terms, so three. So 4 · 3 = 12.

With five elements, it would look like this: 2, 4, 6, 8, 10. Add and subtract four to the outermost elements, and two to the second to last.

$$\begin{eqnarray} a_i&=&(2+4), (4+2), 6, (8-2), (10-4)\\ a_i&=&6{,}6,6{,}6,6 \end{eqnarray}$$

Again, just multiply 6 · 5 = 30. What do we see? We always multiply the number of members of the sequence by the middle member of the sequence. In the sequence 2, 4, 6 there was a 4 in the middle and in the sequence 2, 4, 6, 8, 10 there was a 6 in the middle. How do we calculate the middle element in general (let's denote p)? We calculate it as the average of the first and last elements of the sequence, i.e.

$$p=\frac{a_1+a_n}{2}$$

For example, for the second sequence

$$p=\frac{2+10}{2}=6.$$

The resulting formula for the sum of the first q members of the sequence an would look like this:

$$S_q=q\cdot\frac{a_1+a_q}{2}$$

The formula holds for an even number of elements, even though we used only an odd number of elements in the derivation.

How to calculate the difference

How to calculate the difference if you know the two terms of the sequence. Let's stay with even numbers. Suppose we know the following two members of the sequence

$$a_3=6,\quad a_7=14.$$

How do we calculate the differential? First we calculate the difference between these two elements:

$$a_7-a_3=14-6=8$$

Now we just need to divide this result by the number of elements that are between the two elements we know:

$$\frac{a_7-a_3}{7-3}=\frac{8}{4}=2.$$

The difference is two. The resulting formula for calculating the difference d, if we know the elements of the sequence ak and al:

$$d=\frac{a_l-a_k}{l-k}$$

The graph of an arithmetic sequence exhibits either a constant increase or a constant decrease - isolated points in the graph lie on the same line.

Graph the sequence a_n=3n

A geometric sequence

A geometric sequence differs from the previous arithmetic sequence in that two adjacent terms do not have the same difference, but a proportion. This proportion is then not called the difference as in the case of an arithmetic sequence, but the quotient (denoted by q). For example, we could have a sequence where q = 10 and the first element would be 5:

$$\begin{eqnarray} a_1&=&5\\ a_2&=&a_1\cdot10\quad(=50)\\ a_3&=&a_2\cdot10\quad(=500)\\ a_4&=&a_3\cdot10\quad(=5000)\\ \end{eqnarray}$$

In general, the formula thus holds:

$$a_{n+1}=a_n\cdot q$$

The formula for the general term of a geometric sequence would look like this:

$$a_n=a_1\cdot q^{n-1}$$

For example, we would calculate the third element of the previous sequence as follows:

$$\begin{eqnarray} a_3&=&a_1\cdot q^{3-1}\\ a_3&=&5\cdot q^2\\ a_3&=&5\cdot10^2\\ a_3&=&500 \end{eqnarray}$$

Geometric sequences can be further divided into two more groups according to their quotient. If the absolute value of the quotient is less than one, the whole sequence will go down to zero. Such a sequence is therefore called convergent. Conversely, if the absolute value of the quotient is greater than one, the sequence will rush towards infinity and is called a divergent sequence. For a convergent sequence, then, the simple formula for the sum of a whole series applies (it applies only to the convergent sequence because the divergent sequence approaches infinity and so its sum is infinity):

$$S_a=\frac{a_1}{1-q}.$$

Formula for the sum of the first i elements of a geometric sequence an:

$$S_i=a_1\cdot\frac{q^i-1}{q-1}$$

You can read the derivation of the formula on Wikipedia.

The graph of a geometric sequence, except when the quotient is one or zero, is the set of isolated points that do not lie on a single line. A typical graph of geometric psolality looks like this:

Graph a geometric sequence with quotient q=1.2 and a_1=1.2

If the quotient is negative, the graph will have two branches:

Graph a geometric sequence with quotient q=-1.2 and a_1=-1.2