5. Recursion and Iteration
Sign In
1, x, 3x+6, 15x+18, 63x+90
a_1&=1 a_2&=x a_n&=3a_(n-1)+6a_(n-2) To do so, we will use a table. To find a_3, we will substitute 3 for n in the formula above. To find a_4, we will substitute 4 for n, and so on.
| n | a_n=3a_(n-1)+6a_(n-2) | 3a_(n-1)+6a_(n-2) | a_n |
|---|---|---|---|
| - | a_1= 1 | - | - |
| - | a_2= x | - | - |
| 3 | a_3=3a_(3-1)+6a_(3-2) ⇕ a_3=3a_2+6a_1 |
a_3=3 a_2+6 a_1 ⇓ a_3=3 x+6( 1) |
a_3= 3x+6 |
| 4 | a_4=3a_(4-1)+6a_(4-2) ⇕ a_4=3a_3+6a_2 |
a_4=3 a_3+6 a_2 ⇓ a_4=3( 3x+6)+6 x |
a_4= 15x+18 |
| 5 | a_5=3a_(5-1)+6a_(5-2) ⇕ a_5=3a_4+6a_3 |
a_5=3 a_4+6 a_3 ⇓ a_5=3( 15x+18)+6( 3x+6) |
a_5= 63x+90 |
The first five terms of the sequence are 1, x, 3x+6, 15x+18, and 63x+90.