6. Recursively Defined Sequences
Sign In
The given rule means that after the first term of the sequence, every term f(n) is the sum of the previous terms f(n-1) and f(n-2).
f(2) = 5, f(5) = 23, f(10) = 254
We are asked to write the 2nd, 5th and 10th term of a sequence, given a recursive rule and the first two terms.
\be
| n | f(n)=f(n-1)+f(n-2) | f(n) |
|---|---|---|
| 1 | f( 1)=4 | 4 |
| 2 | f( 2)=5 | 5 |
| 3 | f( 3)=f( 3-1)+f( 3-2) ⇕ f(3)= f(2)+ f(1) |
f(3)= 5+ 4 ⇕ f(3)= 9 |
| 4 | f( 4)=f( 4-1)+f( 4-2) ⇕ f(4)= f(3)+ f(2) |
f(4)= 9+ 5 ⇕ f(4)= 14 |
| 5 | f( 5)=f( 5-1)+f( 5-2) ⇕ f(5)= f(4)+ f(3) |
f(5)= 14+ 9 ⇕ f(5)= 23 |
| 6 | f( 6)=f( 6-1)+f( 6-2) ⇕ f(6)= f(5)+ f(4) |
f(6)= 23+ 14 ⇕ f(6)= 37 |
| 7 | f( 7)=f( 7-1)+f( 7-2) ⇕ f(7)= f(6)+ f(5) |
f(7)= 37+ 23 ⇕ f(7)= 60 |
| 8 | f( 8)=f( 8-1)+f( 8-2) ⇕ f(8)= f(7)+ f(6) |
f(8)= 60+ 37 ⇕ f(8)= 97 |
| 9 | f( 9)=f( 9-1)+f( 9-2) ⇕ f(9)= f(8)+ f(7) |
f(9)= 97+ 60 ⇕ f(9)= 157 |
| 10 | f( 10)=f( 10-1)+f( 10-2) ⇕ f(10)= f(9)+ f(8) |
f(10)= 157+ 97 ⇕ f(10)= 254 |
Therefore, f(2) = 5, f(5) = 23 and f(10) = 254.