5. Recursion and Iteration
Sign In
12, 13, 15, 18, 22
We are asked to write the first five terms of a sequence, given a recursive formula.
| n | a_(n+1)=a_n+n | a_n+n | a_(n+1) |
|---|---|---|---|
| - | a_1= 12 | - | - |
| 1 | a_(1+1)=a_1+ 1 ⇕ a_2=a_1+ 1 |
a_2= a_1+1 ⇓ a_2= 12+1 |
a_2= 13 |
| 2 | a_(2+1)=a_2+ 2 ⇕ a_3=a_2+ 2 |
a_3= a_2+2 ⇓ a_3= 13+2 |
a_3= 15 |
| 3 | a_(3+1)=a_3+ 3 ⇕ a_4=a_3+ 3 |
a_4= a_3+3 ⇓ a_4= 15+3 |
a_4= 18 |
| 4 | a_(4+1)=a_4+ 4 ⇕ a_5=a_4+ 4 |
a_5= a_4+4 ⇓ a_5= 18+4 |
a_5= 22 |
The first five terms of the sequence are 12, 13, 15, 18, and 22.