A sequence is an **ordered** set; usually the objects in the set (often numbers) are written with commas between them. e.g. 1,3,5,7 is a finite sequence, 1,3,5,7,... is an infinite sequence as is 2,4,8,16,... or 2,3,5,7,11,13,17,... (the primes.) The elements of the sequence are called terms; since the elements are ordered we can speak of the first term or `a_1` , second term `a_2` and the nth term `a_n` .

Sometimes there is a rule or rules that allow you to find terms of the sequence.

A term to term rule allows you to find the next number in the sequence if you know the previous term (or terms.) This is also called a recursive rule. For example, if the sequence is 1,3,5,7,... then in order to find the next term you add 2 to the previous term. `a_5=a_4+2` or in general `a_n=a_(n-1)+2` . The drawback to such a rule is that you have to know the previous terms. If I ask for the 100th term in this sequence, you must know the 99th term.

A position to term rule, also called an explicit rule, allows you to compute the value of any term. For the example 1,3,5,7,... the nth term is `a_n=2n-1` . Thus the fifth term is 2(5)-1=9. The 100th term is 2(100)-1=199.

Sometimes finding a position to term rule is difficult. The Fibonacci sequence 1,1,2,3,5,8,13,... has as a term to term rule `a_1=1,a_2=1, a_n=a_(n-2)+a_(n-1)` for `n>=3` .

The position to term rule is `a_n=(((1+sqrt(5))/2)^n-((1-sqrt(5))/2)^n)/sqrt(5)` .

Some sequences admit no known rule of either type, for instance the sequence of primes.