## Sequences

Published: Dec 29th, 2020

The next few lessons will discuss sequences. Your teacher may not cover this subject, but it does become relevant in upper-year math and in some computer science courses.

With that disclaimer out of the way, let's get to it!

A function that takes on natural number input will generate a set of values called a sequence

For example, the function $$f(n) = 3n+5$$$$n \in \mathbb{N}$$, generates the set of values $$8, 11, 14, 16, ...$$ when $$n$$ is set as $$1,2,3,4,...$$. Each number in a sequence is called a term

Some sequences are finite. For example, $$1,3,5,7,9,...,15$$ is a finite sequence because it has a finite number of terms—eight.

Others are infinite$$1,3,5,7,9,...$$ is infinite because it does not have an end term, so it has an infinite number of terms.

In some cases, a sequence may be defined recursively. In other words, the sequence is defined relative to the term before! Sounds weird, right?

Let me show you an example: $$t_n = t_{n-1} + n$$. To get the value $$t_n$$, we need to add $$n$$ to the value before, $$t_{n-1}$$.

Now you might be wondering, "where do we get the very first value from?" Well, that value is called $$t_1$$ and is usually already given in the question.

Alright, with introductions out of the way, let's go through some examples:

Give the first five terms in $$f(n) = n+1$$$$n \in N$$

You might be surprised that we're using $$n$$ as a variable rather than $$x$$, to which you might have become accustomed. Well, that's a convention used to remind ourselves that our domain should be part of the natural number family, $$\mathbb{N}$$

In this case, for inputs $$1,2,3,4,5$$, we'd get the outputs $$2,3,4,5,6$$

Remember that the natural numbers are the counting numbers, and they do not include zero, so we'd start at 1. For more on the different types of numbers, give Lesson #4: Types of Numbers a look.

That was pretty simple, no? Let's move on!

Give the first five terms in $$t_n = 2^{n-1}$$$$n \in N$$

Whoa, where's the $$f(n)$$? Well, in sequences, we can alternatively use the $$t_n$$ notation. This becomes especially useful when we discuss recursive sequences. I'll get to that shortly.

Let's do a few examples:

$$t_1 = 2^{1-1}$$

$$t_1 = 2^{0}$$

$$t_1 = 1$$. So, our first term is 1

$$t_2 = 2^{2-1}$$

$$t_2 = 2^{1}$$

$$t_2 = 2$$. The second term is 2. You get the gist.

Therefore, for the inputs $$1,2,3,4,5$$, our outputs would be $$1,2,4,8,16$$

Now, recursive sequences.

For the sequence $$t_1=5$$$$t_n = t_{n-1} + 3n$$$$n \in N$$$$n \gt 1$$, find the next 4 terms.

Let's put the recursive definition into words: "the next value of the function is equal to the previous value, plus 3 times the term number."

Alright, now let's try to solve a few:

$$t_2 = t_{2-1} + 3(2)$$

$$t_2 = t_{1} + 6$$

$$t_2 = 5 + 6$$

$$t_2 = 11$$. So, the second term is 11. Now, the next term:

$$t_3 = t_{3-1} + 3(3)$$

$$t_3 = t_{2} + 9$$

$$t_3 = 11 + 9$$

$$t_3 = 20$$

Continuing the pattern, we get $$20 + 12 = 32$$, and $$32 + 15 = 47$$.

In some cases, we may be given the sequence but are asked to find the function from which it came, also called the general term. Let's try a few examples:

For the sequence $$7,14,21,28,35,...$$, find the general term

If the pattern here isn't immediately obvious, one way to approach the problem is using first differences, or the differences between consecutive terms.

For example, $$14-7= 7$$$$21-14 = 7$$$$28-21 = 7$$, and so on. Note that the first differences are always the same. This means that the function here is linear, and follows the form $$ax+b$$

In this case, we can see that the differences between terms is always 7. We can therefore use this number as $$a$$, or the rate of change / slope, giving $$7x + b$$.

Let's try without a value for $$b$$, or $$b=0$$. This gives $$7x$$. For inputs $$x=1,2,3,4,5$$$$f(x) = 7x$$ gives $$7, 14, 21, 28, 35$$. We've got it!

Therefore, our general term is $$t_n = 7n$$

For the sequence $$\frac{1}{2}, \frac{2}{3}, \frac{3}{4}, \frac{4}{5},...$$, find the general term

This pattern is a bit more complicated; let's express it in tabular format:

 $$n$$ $$f(n)$$ $$1$$ $$\frac{1}{2}$$ $$2$$ $$\frac{2}{3}$$ $$3$$ $$\frac{3}{4}$$ $$4$$ $$\frac{4}{5}$$

Notice that the numerator of each fraction is equal to $$n$$.

What about the denominator? It's one more than $$n$$, or $$n+1$$.

Therefore, we can express the general term as $$f(n) = \frac{n}{n+1}$$.

With that, we've covered the basics of sequences. Be sure to try some practice problems.