In: Computer Science
For the following exercises, write the first eight terms of the sequence.
Consider the sequence defined by the recursive formula,
a1 = 2
a2 = 10
an = 2(an-1 + 2)/an-2
First two terms of the sequence are provided in the formula as follow:
a1 = 2
a2 = 10
Compute third term of the sequence by substituting n = 3 in formula an = 2(an-1 + 2)/an-2
a3 = 2(a2 + 2)/a1
= 2(10 + 2)/2
= 2
Compute forth term of the sequence by substituting n = 4 in formula an = 2(an-1 + 2)/an-2
a4 = 2(a3 + 2)/a2
= 2(12 + 2)/10
= 14/5
Compute fifth term of the sequence by substituting n = 5 in formula an = 2(an-1 + 2)/an-2,
a5 = 2(a4 + 2)a3
= 2(14/5 + 2)/12
= (2 × 24/5)/12
= 4/5
Compute sixth term of the sequence by substituting n = 6 in formula an = 2(an-1 + 2)/an-2
a6 = 2(a5 + 2)/a4
= 2(4/5 + 2)/14/5
= 2 × 14/14
= 2
Compute seventh term of the sequence by substituting n = 7 in formula an = 2(an-1 + 2)/an-2,
a7 = 2(a6 + 2)/a5
= 2(2 + 2)/4
= 2 × 4/(4/5)
= 10
Compute 8th term of the sequence by substituting n = 8 in formula an = 2(an-1 + 2)/an-2,
a8 = 2(a7 + 2)/a6
= 2(10 + 2)/2
= 12
Therefore, the first eight terms of the given sequence are as follow:
{2, 10, 12, 14/5, 4/5, 2, 10, 12}
The first eight terms of the given sequence are as follow:
{2, 10, 12, 14/5, 4/5, 2, 10, 12}