# Sequence basics

Through life you familiarized yourself with different kinds of simple sequences. You usually knew at first sight how is that sequence made and how to continue one. Now you will get to know a lot more different mathematical sequences and be able to do many operations with them.

Every sequence of numbers can be infinite and finite. As the same name says, infinite sequence of numbers has infinitely many members, and finite has finitely many members.
Before jumping to examples and tasks we should define what sequences are.

Function defined on the set of real numbers is an infinite sequence $f : \mathbb{N} \rightarrow \mathbb{R}$, $n \Rightarrow f (n) = a_n$

Finite sequences are simply functions that are given only on a particular part of the natural numbers.

If $A = \{ 1, 2, 3, 4,…,n \}$, where $n$ is a natural number, then $f : S \rightarrow \mathbb{R}$, $n \Rightarrow f (n) = a_n$ is the finite sequence.

Simplified, sequence of real numbers is a function that takes every natural number and appends it a real number. If we have a given function , we usually write it in a following way:

$f(1) = a_1, f(2) = a_2, f(3) = a_3, …, f(n) = a_n$ or $a_1, a_2, a_3, …, a_n$

Here $a_1$ is called leading member of the sequence, and is called nth or general member of the sequence.

## Making sequences

The key point in making sequences is knowing the function or a formula that it is given with. Usually that formula is given so that general member is expressed by some ordinal number $n$.

Example 1. If general member is given with the formula $a_n = 2 (2n – 5)$ write first four members of this sequence.

If we want to know what is the value of $a_1$, we should simply insert $1$ instead of $n$, and in the same way we could get any other member of this sequence.

$a_1 = 2(2 – 5) = -6$

$a_2 = 2(4 – 5) = -2$

$a_3 = 2(6 – 5) = 1$

$a_4 = 2(8 – 5) = 6$

-6, -2, 1, 6

Of course, sequences can be given using many different formulas but as long as their general member is given you can find any member by simply inserting the ordinal number of that member you want to find.

Example 2. Find $202.$ And $303.$ member of the sequence that is given by its general member

$a_n = \frac{n + 2}{n}$

$a_202 = \frac{202 + 2}{202} = \frac{204}{202} = \frac{102}{101}$

$a_303 = \frac{303 + 2}{303} = \frac{305}{303}$

These aren’t that hard. But what happens if we can’t find every member with just inserting its ordinal number? This is where things with sequences get interesting. If we define one member of the sequence using one or more previous members, we say that we defined them using recursive formula or recursion.

Recursive formula or a recursion is a formula in which the general member of the sequence is defined by using previous members.

Example 3. Let’s say we have a sequence that is given with $a_n = a_{n – 1} + 3$, where $a_1 = 15$. Calculate first four members.

In recursions, first few members (as much as the recursion requires) has to be given in the task. Otherwise we could not even start calculating.

The first step is to calculate and then, using calculating other two members.

$a_2 = a_1 + 3 = 15 + 3 = 18$

$a_3 = a_2 + 3 = 18 + 3 = 21$

$a_4 = a_3 + 3 = 21 + 3 = 24$

15, 18, 21, 24

Example 4. If $a_1 = a_2 = 1$, $a_n = a_{n – 1} + a_{n – 2}$, write first seven members of this sequences.

$a_1 = 1$

$a_2 = 1$

$a_3 = 1 + 1 = 2$

$a_4 = 2 + 1 = 3$

$a_5 = 3 + 2 = 5$

$a_6 = 5 + 3 = 8$

$a_7 = 8 + 5 = 13$

This is called the Fibonacci sequence.