Here are some sequences:
|
|
|
|
|
|
A sequence is a function whose domain is a subset of the natural numbers.
|
|
List Comprehension has this form:
[f(x) for x in domain].
domain represents some interval.
|
|
|
|
|
|
|
|
|
|
|
|
If \{a_n\} is some sequence, then the expression \lim_{n \rightarrow \infty} a_n = L means that the values of the sequence get closer and closer to some value L as n continues to gets larger and larger. We say that the sequence converges to the value L and that L is the limit of the sequence. If there is no such value that the sequence approaches, then we say that the sequence diverges.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\{a_n\} = \{a, a+d, a+2d, ..., a+(n-1)d\}
|
|
|
|
Here is an example of a generator:
|
|
Generators are essentially functions, but generators yield their values rather than return them.
When a function returns its value, it is finished and forgets its state. If you call it again, it has no record of what it did before.
When a generator yields its value, it stays 'on call' ready to generate the next value. It remembers its state.
Generators are great for conserving resources. Instead of generating a complete sequence at once, they generate terms as needed.
This can be important if you are dealing with a very large sequence of a very complex formula.
|
|
|
|
|
|
|
|
|
|
Sage interval notation:
|
|
a) d = 4
|
|
b) 10th term
|
|
d) Simplified nth Term
|
|
|
|
c) Recursive Rule
|
|
|
|
|
|
a) d = \ln{6} - \ln{3}
|
|
b) 10th term
|
|
|
|
d) Simplified nth term
|
|
|
|
c) Recursive Rule
|
|
|
|
\{a_n\} = \{a, ar, ar^2, ..., ar^{n-1}\}
|
|
|
|
|
|
|
|
|
|
Here's an example of a generator for a geometric sequence:
|
|
|
|
|
|
|
|
|
|
The second and fifth terms of a sequence are 3 and 24.
Find the explicit and recursive formulas if it is a) arithmetic and b) geometric:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|