Sequences can be built based on formulae. The formulae are based on two main elements: n, which is the current term, and `U_n`, which is the value of the term n.
`U_(n-1)` is the value of the term immediately prior to the nth term. This terminology allows for more complex sequences to be created.
In some instances, initial values, or seed values. are required to begin the generation of a sequence when the sequence generator refers to the value of an earlier term.
For example, `frac(U_(n-1)^2)(n^2)` means take the value of the previous term and square it, then divide that by the square of the current term. If the value of the first term is 3 (`U_1=3`), then the value of the second term is `frac(3^2)(2^2)` as `U_(n-1)` refers to the value of the previous term (3) and `n` has the value 2 as it is the second term.
1. What are the first five terms of the sequence given by `U_n = n^2 - n?`
Answer: 0, 2, 6, 12, 20
2. Write, in terms of `U` and `n`, a sequence where the value of the term is equal to the values of the previous two terms.
Answer: `U_n =U_(n-1) + U_(n-2)`
The value of the current term is given by `U_n`, the previous values are given by `U_(n-1)` (the value of the term before) and `U_(n-2)` (the value of the term before that).
This is the Fibonacci sequence.