# Sequences

A sequence is a list of numbers written in a specific order. Sequences have a pattern that makes it possible for the reader to determine the next numbers in the sequence. Each of the numbers in a sequence is referred to as a term, element, or member. The example below shows a sequence comprised of natural numbers in which the first term is 1 and each subsequent term increases by 1:

{1, 2, 3, 4, 5, 6, 7, 8, 9, 10...}

The "..." indicates that the sequence continues infinitely. A finite sequence can be written in a similar manner, just without the "..." at the end of the sequence. Although sequence notation may look similar to set notation, they have significant differences. For example, sequences can include repeated values while sets cannot, and the order of terms in a sequence matters, while the order of terms in a set does not. Consider the following sequence:

{1, 3, 2, 1, 3, 2, 1, 3, 2}

The 1, 3, and 2 are repeated 3 times. If the above were viewed as a set rather than a sequence, it can be simplified to any of the following:

{1, 3, 2} or {2, 3, 1} or {1, 2, 3} etc.

Sequences on the other hand cannot be simplified, since a defining factor of a sequence is the order in which the terms are listed. If any of the terms in the above sequence were moved, removed, or otherwise changed, it would not be the same sequence.

## Sequence notation

In order to work with sequences, it is necessary to be familiar with the notation used. Sequences are typically named using an upper case letter, such as S. For example:

S = {1, 2, 1, 2, 1, 2,...}

The terms within a sequence are named using a variable, such as a, with a subscript i or n, which is referred to as the index. The index tells us which term in the sequence is being referenced. For example:

 a1 - first term a2 - second term a5 - fifth term a(n-1) - (n-1)th term an - nth term a(n+1) - (n+1)th term

Referencing the above sequence, S, a1 = 1, a3 = 1, a4 = 2, and so on. In this example, since the sequence repeats itself, every even n will be 2, and every odd n will be 1.

Depending on the sequence, it is often tedious to have to list all of its terms. One of the reasons sequence notation is useful is because it enables us to write sequences as a function of n. Consider the sequence of all even numbers:

{0, 2, 4, 6, 8, 10, 12,...}

Rather than having to write out each number, it is possible to re-write the above sequence very efficiently as a function of n:

an = 2n

The above equation states that the value of any given term can be computed by multiplying the corresponding n by 2, allowing us to quickly determine the value of any term within the sequence as follows:

 a0 = 2n = 2 · 0 = 0 a1 = 2n = 2 · 1 = 2 a5 = 2n = 2 · 5 = 10

Notice that writing sequences in this way can be much more efficient than using a list of terms to represent a sequence. It also provides the added benefit of making it easier to compare sequences with one another in cases where multiple sequences are being handled at the same time. When dealing with multiple sequences, it is common to use different variables such as b or c.

The sequences discussed above are relatively simple. There are many different types of sequences, many of which are more complex and more difficult to express. Consider the Fibonacci sequence, which is a recursive sequence. A recursive sequence is one in which the next term in the sequence is defined in terms of the previous terms. Refer to the definition of a Fibonacci sequence shown below in sequence notation:

a1 = a2 = 1

For n ≥ 3,

an = an-1 + an-2

The first part of the definition states that the first two terms in the sequence are both 1, and the subsequent terms in the sequence are the sum of the previous two terms. Thus, a3 = 1 + 1 = 2, a4 = 1 + 2 = 3, and so on. The first 10 terms of the Fibonacci sequence are shown below:

{1, 1, 2, 3, 5, 8, 13, 21, 34, 55}

Note that in some cases, the Fibonacci sequence starts from 0 and 1, or sometimes even 1 and 2. The rule for determining the subsequent terms however, remains the same.

The sequences discussed above are relatively simple. Sequences can get far more complex, but are important as a basis for series.