Worked example: using recursive formula for arithmetic sequence | High School Math | Khan Academy
We are told b of 1 is equal to negative 7, and b of n is equal to b of n minus 1 plus 12. They’re asking us to find the fourth term in the sequence. So, what we have up here, which you could use a function definition, it's really defining the terms of a sequence.
Especially if you were to input whole numbers in here, it’s the index on your sequence. So what we really want to do is we want to figure out what is b of 4 going to be equal to. Well, if we just blindly apply this, we would say, all right, b of 4.
So b of n is equal to b of n minus 1 plus 12. So it's going to be b of 4 minus 1 plus 12. Well, 4 minus 1 is just 3. So it's going to be equal to b of 3 plus 12. All I did is said, okay, well, we're not trying to figure out or we're not immediately trying to figure out what b of 1 is; we're trying to figure out what b of 4 is. So n is equal to 4.
So b of 4 is going to be equal to b of 4 minus 1, or b of 3 plus 12. Well, to evaluate this, we have to figure out what b of 3 is. So let's write that down. That’s what's fun about a recursive definition; you have to keep recursing backwards.
So b of 3, well, if n is 3, that's going to be equal to b of now n minus 1 is 2, b of 2 plus 12. Well, we don't know what b of 2 is; let's keep going. So we need to figure out b of 2. If we use the same definition, b of 2 is going to be equal to b of 2 minus 1 plus 12.
So b of 2 minus 1, that’s b of 1 plus 12. But we don't know what b of 1 is, so let's figure that out. b of 1 is equal to, well, here we can finally use this top clause, so b of 1 is equal to negative 7.
So now we can go and fill everything back in. If b of 1 is equal to negative 7, then we know that this right over here is negative 7. Now we can figure out that b of 2 is equal to negative 7 plus 12, which is equal to 5.
Well, if b of 2 is equal to 5, well then this is equal to 5 right over here. Then now we know that b of 3 is equal to 5 plus 12, which is equal to 17. Well, if we know that b of 3 is equal to 17, then we're ready to calculate what b of 4 is going to be.
b of 4 is now b of 3, which we figured out was 17 plus 12, which is equal to 29. And we are done.