219k views
0 votes
How do you find the first five terms of a sequence defined recursively

User ManniAT
by
6.9k points

1 Answer

2 votes
Interesting question. Good to know for computer science.
Suppose you have a function like
an = 3x - 2 Try the first couple
a1 = 3(1) - 2
a1 = 3 - 2
a1 = 1

a2 = 3(2) - 2
a2 = 6 - 2
a2 = 4 So each term differs by 3
a2 - a1 = 3

an = a_(n - 1) + 3
a3 = a2 + 3
a3 = 4 + 3
a3 = 7

a4 = a3 + 3
a4 = 7 + 3
a4 = 10

a5 = a4+ 3
a5 = 10 + 3
a5 = 13

I'll do one more and then check it.
a6 = a5 + 3
a6 = 13 + 3
a6 = 16

a6 = 3x -2
a6 = 3*6 - 2
a6 = 18 - 2
a6 = 16 which checks.

So the general formula is
an = a_(n - 1) * k if you were multiplying or
an = a_(n - 1) + k if you were adding. The key thing is that you are working with the previous term.
User Ffgiraldez
by
6.6k points