Sequences
A sequence is a function whose domain is the set of positive integers. A sequence can be infinite, if its domain is the whole set of positive integers, or finite, if its domain is only a finite subset of the positive integers. Unless it is stated explicitly that a sequence is finite, it is assumed to be infinite.
Definition of a sequence
This section describes, at least a little, what the definition of a sequence means. You don't need to know it, so you can skip the whole section if you like.
The introduction has already revealed that a sequence is a function whose domain is the positive integers. The range can be any set, but here we will assume the set of real numbers. What does this mean? The most visible change is in the graph of the function: it is not a continuous line, as is usual for ordinary functions, but just scattered, isolated points of the sequence.
A sequence can be, for example, the list of numbers 1, 3, 5, 7, 9, 11, … This is a fairly clearly defined sequence, and it should be obvious to everyone how it continues. Because it is a function, the table of its mapping would look like this:
The numbers in the first column (the values from the domain) give the position of the number in the sequence. For example, in our simple sequence the number five is in third position, which is exactly what the table tells us. In fourth position is the number seven, in first position the number one, and so on. It also follows that the domain of a finite sequence p should be a set of the form
so that it really is about order and no position is skipped. For example, the set
is not suitable as the domain of a sequence, because it is missing the fourth and sixth positions.
So a sequence expresses the fact that its terms can be put in some order: every term except the first and the last has a predecessor and a successor. This is a huge difference from real functions, where nothing like that holds. 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.
Writing a sequence
We already know that – put simply – a sequence is a numbered list of numbers. Now let's look at how a sequence can be written. We usually name a sequence with a lower-case letter with a subscript, for example ai.
The first way is to list all the terms of the sequence. We have already met this in the previous section. The list can be finite or infinite:
Note: I'm not sure which brackets are normally used for sequences, as I haven't found a uniform convention. I probably wouldn't use curly brackets, because those denote sets, where order doesn't matter, whereas for sequences the order of the terms does matter.
The second option is a formula for the nth term of the sequence. For example, the sequence an contained all the even numbers. We could express that with the formula
The subscript n tells us which term of the sequence we are working out. So if we want the first term, we want a1, and if we want the seventh, a7. We would then work out the seventh term by substituting into the formula.
This way of writing is useful because it lets us work out any term of the sequence straight away. Another option is a recurrence relation (a term-to-term rule). A recurrence relation lets us work out the next term if we know the current one. In other words, if we know the term an, it lets us work out the term an + 1.
To give a sequence by a recurrence relation, we have to state two pieces of information: what the first term is, and the rule for working out the (n + 1)th term. If we wanted to give the sequence of even positive integers by a recurrence relation, we could do it like this:
How would we work with this? We know that a1 is equal to two. Now we substitute one for n, so we work out a2 by adding two to a1. We get four, the second even number. And so on.
A recurrence relation is useful when we need to generate a longer part of the sequence. It is not useful when we want to work out one particular term, because to work out the hundredth even number we would first have to work out all 99 even numbers that come before it.
The last option is to give a sequence by its graph.
One more point to make things clear: a sequence doesn't necessarily have a simple formula, and it doesn't have to be a “sensible” list of numbers. Even this list of numbers is a sequence, although at first glance it has no deeper meaning:
Graph of a sequence
Sequences have different graphs from ordinary real functions. Because their domain is the positive integers, their graph consists of isolated points.
Arithmetic sequence
An arithmetic sequence is a simple sequence with a constant difference between consecutive terms. Each term is, for example, three more or perhaps seventeen less than the one before. The difference by which the terms of the sequence differ is called the common difference (denoted d). In the first case the common difference would be three, in the second minus seventeen, and for the sequence of even numbers it would be two. We could therefore write an arithmetic sequence with the formula
The general formula for the nth term of an arithmetic sequence is then
So, as an example, let's take the even numbers again, where the common difference is two and the first even number is also two. Then we get the second even number by adding two to the first. If we add two once more, we get the third even number.
If we wanted to work out, say, the seventh even number, we would substitute into the general formula like this:
How do you tell whether a given sequence is arithmetic? We subtract the formula for the nth term from the formula for the (n + 1)th term, and if we get a constant, that is the common difference and the sequence is arithmetic. For example, take the sequence
Is this sequence arithmetic? We start by writing the (n + 1)th term:
Now we subtract these two expressions:
We can see that after subtracting we got d = 2, so this is an arithmetic sequence with common difference two.
Sum of the terms of an arithmetic sequence
We often need to find the sum of the first few terms of an arithmetic sequence. How would we do that? Intuitively, something like this. We'll stick to the even numbers. What is the sum of the first three even numbers? That is, of the numbers 2, 4 and 6. We can of course just add them up one by one, but we don't want that – we want a formula.
We adjust the sequence like this: we add two to the first term and subtract two from the last. We get 4, 4, 4. We can see that we have three equal numbers, so it is enough to multiply four by the number of terms, that is, by three. So 4 · 3 = 12.
With five terms it would look like this: 2, 4, 6, 8, 10. We add and subtract four at the ends, and two at the second and second-last terms.
Again it is enough to multiply 6 · 5 = 30. What do we see? We always multiply the number of terms of the sequence by the middle term of the sequence. In the sequence 2, 4, 6 the middle was four, and in the sequence 2, 4, 6, 8, 10 the middle was 6. How do we work out the middle term in general (let's call it p)? We work it out as the mean of the first and last terms of the sequence, that is,
For example, for the second sequence
The resulting formula for the sum of the first n terms of the sequence an would look like this:
The formula also holds for an even number of terms, although in the derivation we only used an odd number of terms.
Finding the common difference
How do you find the common difference if you know two terms of the sequence? Let's stay with the even numbers. Say we know these two terms of the sequence
How do we work out the common difference? First we work out the difference between these two terms:
Now it is enough to divide this result by the number of steps between the two terms we know, that is, by the difference of their indices:
The common difference is two. The resulting formula for the common difference d, if we know the terms ak and al of the sequence, is
The graph of an arithmetic sequence shows constant growth or constant decrease – the isolated points in the graph lie on one straight line.
Geometric sequence
A geometric sequence differs from the arithmetic sequence above in that two neighbouring terms don't have a constant difference but a constant ratio. This ratio is not called the common difference, as for an arithmetic sequence, but the common ratio (denoted r). For example, we could have a sequence where r = 10 and the first term is 5:
In general, the following formula holds:
The formula for the general term of a geometric sequence would look like this:
For example, we would work out the third term of the previous sequence like this:
We can divide geometric sequences into two more groups, according to their common ratio. If the absolute value of the common ratio is less than one, the whole sequence approaches zero. Such a sequence is called convergent. On the other hand, if the absolute value of the common ratio is at least one, the sequence does not approach zero and is called a divergent sequence. For a convergent sequence there is a simple formula for the sum of the whole series (it holds only for convergent sequences, because a divergent one has no finite sum):
The formula for the sum of the first n terms of a geometric sequence an:
You can read the derivation of the formula on Wikipedia.
The graph of a geometric sequence, except when the common ratio is equal to one or zero, is a set of isolated points that do not lie on one straight line. A typical graph of a geometric sequence looks like this:
If the common ratio is negative, the graph has two branches: