00:01
So we'd like an algorithm here that will compute n times x whenever n is a positive integer and x is just an integer.
00:08
So we're only allowed to use addition here.
00:10
First of all, x is an integer, or n is a positive integer, right? so if n equals 1, this can be our base case, then the value is going to be x, right? 1 times x is x.
00:29
If n equals 2, then let's play around with this a little bit.
00:34
It's going to be 2 times x, of course.
00:35
We're only allowed to use addition, so that's x plus x.
00:39
N equals 3, with addition, is x plus x plus x.
00:45
N equals 4, x plus x plus x plus x.
00:52
And what i'm going to notice here, actually, is here we have just x.
00:58
Here, all of these further terms have x plus x, which is just 2 times x.
01:05
All of these have 3 times x...