In the previous video, we looked at patterns in sequences, and I think you and I came to the conclusion that our way of describing them was a little bit ambiguous and sometimes hard to define precisely with words. Now, we're going to define them more precisely here. To start with, sequences have a name, which is usually a letter. Now, each number in the sequence is labeled according to the order it appears. So, for example, in the sequence A that has terms A1, A2, A3, and so on, and that little number appears as a subscript. If there is an expression to compute the terms of the sequence, we then have a variable for the order. For example, N, and we write AN with the N in subscript as the general term of the sequence. An example of such expression could be AN equals N. This means that the sequence A will be term A1 is one, A2 equals two, A3 equals three, and so on. Let's see the examples from the last video. The sequence of week days, we would have B1 equals Monday, B2 is Tuesday, B3 Wednesday, B4 is Thursday, B5 equals Friday, B6 equals Saturday, and B7 equals Sunday. The general term could be written as BN is equals the Nth day of the week, with N ranging between one and seven, which we write one less or equal to N less than or equal to seven. For C, the other sequence, C1 is one, C2 equals minus one, C3 equals one, C4 equals minus one, and so on, and so on, and so on. The general term could be CN is one when N is odd and CN equals minus one if N is even. That is a good enough mathematical description of that sequence. But if you want an even more computational one, we could write CN equals minus one times minus one to the power of N. Check this out. The next sequence with constant threes, D1 equals three, D2 equals three, D3 equals three, D4 equals three, D5 equals three, and so on, the general term would be DN equals three for all N. Next, we had E1 equals one, E2 equals 11, E3 equals 111, E4 equals 1,111, and so on, or you may have read it as E1 equals one, E2 equals one, one, E3 equals one, one, one, E4 equals one, one, one, one. So, the general term could be written as EN equals the string with N consecutive ones, or more computationally, EN equals one plus 10 plus dot dot dot the sum all the way to 10 to the power of N minus one. So, we gave an expression to calculate the Nth term. That means we define the sequence by saying what is the general term, the formula, if you want. There is another way. We can define the sequence by referring to other terms. For example, start with one, then one, then generate the new term by adding the two previous terms, so one plus one, which is two, and so on. So, this would be, I would have one, one, then one plus one is two, then one plus the two is three, then the two plus the three is five, the three plus the five is eight, five plus the eight is 13, and so on. So, this is a different way, this is called giving the recurrence relation. It is self referential, it refers to terms of the sequence to generate a new term. This means I'm not referring to the label value, I'm not referring to the N value. So, more formally, this sequence I just defined can be written as F1 equals one, F2 equals one, those were the first two terms, and then, from N greater or equal to three, we have that F of N equals F of N minus one plus F of N minus two. Those were the previous terms, the numbers, before the FN. Have another look at this N minus one and N minus two appearing in the labels of the terms. Do you find it confusing? If you do, I suggest you get N running from N equals three onwards and replace the value of N in the expressions. So, I mean when N equals one, we already have that F1 is one, that's stated explicitly, N equals two, we have F2 that is also said to us, it's one. But then, when N is three, we enter that part that says, F of N is F of N minus one plus F of N minus two. We need to say, okay, when N is three in my expression, I replace the N by three, so F of three equals, and then, on this part that it's F of N minus one when N is three, N minus one is three minus one, that's two. So, F of two plus F of, well, I've got N minus two. When N is three, I got three minus two, that's one. So, that's what I need to do, I need to do F2 plus F1. Well, F2 is there, F1 is there, add them up. One plus one, that is two. So, I've got my F3. Then, for N equals four, F of four equals, let's look at my recurrence relation over there, when N is four, I got F4 equals F of N minus one. When N is four, I am looking at four minus one, which is three, so F of three plus, over there, F of N minus two. So, that's F of four, take away two, that is F of two. That means the F of three, which I got here, which is a two, add the F of two, which is there, and I've got value three. So, I've got one, one, two, three, and then, for the next term, I would just carry on doing the same. So, if you find that a little bit complicated, just continue running the example and replace the values of N in the expression, in the recurrence relation. Let's look at another one. Sequence G, we have G of N given us twice G of N minus one, and then, take away one. That is for n greater or equal to two, and we are told that g of one equals three. So, we start with three. So, g one is three, that's when n equals one. When n equals two, we want g of two. We will replace n equals two on everything in that formula there. So, g equals two is two times the g of n minus one, so that's two minus one, which is g of one, and then take away one altogether. Now, g of one is three, so we do two times three and and take away one. Watch BODMAS, two times three is six, six minus one is five. For n equals three, g of three is twice g of two take away one, so that is two times the previous guy, two times five take away one. So, that's 10 minus one, that's nine, and n equals four, g of four equals two g three minus one. So, that's twice the nine takeaway one, so 18 minus one 17, and so on. So, that sequence goes three, five, nine, 17, and so on. Now, if we look at the differences between consecutive terms, so the second from the third, so five minus three is two, nine minus five is four, 17 minus nine is eight, and the next term is actually 33. So, 33 minus 17 is 16. Interesting pattern. We got powers of two in the differences. Let's see what happens with the second differences, meaning the differences between consecutive numbers in the differences sequence. Four minus two is two, eight minus four is four, 16 minus eight is eight. Does it continue like this? Maybe. We've got the second differences being the same as the differences. What does that mean? Good question. Let's look at the ratio between consecutive numbers. Five divide by three, nine divide by five, 17 divide by nine: is there a pattern? Let's take the sequence as it is and subtract one from all the terms. We get two, then four, then eight, then 16, the same pattern we had in the differences. That's curious. Now, looking at this new sequence two, four, eight, 16, the ratios between consecutive numbers are always two. Four over two is two, eight over four is two, 16 over eight is two, that's interesting. I'm exploring these as these are some of the things you may want to look at when you're trying to find numerical patterns in sequences. You might be looking at differences, second differences, ratios, and you might notice even other patterns like we did. We subtracted one from the sequence and then took ratios. Let's look at another sequence. So, the sequence h n given by the recurrence relation n times the previous term h n minus one, and we're told that h of one equals five. Let's calculate the first five terms. So, h 1 is there, it's five; h two it says it's n times h of n minus one. So, n here is two. So, this is one n equals two. So, we have h of one; that means it's twice the h one. So, it's two times the five, which is 10. When n is three, we're doing the h 3 equals three times h 2. When n is three, that n is three and here we have n minus one, so we have three minus one, which is two. That means three times the previous, so three times 10, which is 30. When n is four, we have h 4, so four times the previous guy. So, four times the 30, which is 120. For h 5, we got five times the h 4. So, five times 120 and that is 600. It carries on in that fashion. Let's see how we can describe this one. D of n is d of n minus one plus two times n minus one, add one. The starting value d 1 is one. So, how does this one go? Let's write it down. So, that's for n greater or equal to two. So, we've got d 1 is given, d 2 is when n is two, so we have d 1 plus two times when n is two n minus one is one, and then like this. So, d 1 is one. So, one, plus two, plus one, that's four. D 3 is n is three, so n minus one is two. So, I have d 2 plus two times d n minus one. So, two times two add one, d 2 was four, so I got four plus four, plus one, that is nine. D 4, so n is four. That means I got d 3 plus two times three plus one. So, that's nine plus six, plus one, which makes 16. Let's do one more. That's going to be d 4, plus two times four, plus one, that is 16, plus eight plus one and that makes 25, and so on. Now, is there a pattern you can see there? It is described as a recurrence relation, but the numbers go as 1, 4, 9, 16, 25 and you're probably thinking this is a square number sequence. It is. We could write it as a square number sequence. So, we could write it as d n equals n squared for every value of n, and at the same time, that is the recurrence relation. So, you can have both. Can you always write a formula, like a general term for sequences given as recurrence relation? That's a good question. We're not going to worry about that in this course, but I'll let you to investigate that for your own satisfaction. We spotted the sequence 1, 4, 9, 16, 25, and so on, given by that recurrence relation could be the sequence of consecutive square numbers. How could we get there? Well, we're not going to get into any proof. I want to get you to look at some of the tools that we just mentioned. We could look at the differences between consecutive numbers. Four minus one is three, nine minus four is five, 16 minus nine is seven. So far, are you thinking these are all prime numbers? Is this going to give us the prime number sequence? No, too early. Twenty minus 16 is nine. So, actually more likely that these are the odd numbers. Now, if we look at second differences, so the differences between consecutive terms in 3, 5, 7, 9, and so on, the difference is always two; constant second difference. Is that a coincidence? Actually, no. D n, if it is a sequence of square numbers, we should expect that that's square, that two in a power should have the sequence of second differences constant. Something that I will not prove here, but I just want to raise your awareness to this kind of pattern. Now, when you work with data and you're looking to find patterns and you're doing this exploration, you can also use a spreadsheet to automate your pattern search. Again, it's beyond the scope of this module, but it's something that you can do to support your investigations. Next, we will look at special types of sequences with simple recurring relation. Join me.