Well you tried
So in a 1 x 1 grid, there would only be 1 square that was 1 x 1 large.
Therefore N
1 = 1; where N
1 is the amount of squares there are when N is equal to 1
In a 2 x 2 grid, there would only be 1 square that was 2 x 2 in the grid and there would be 4 squares (you can count them) that would be 1 x 1 in the grid
Therefore N
2 = 4 + 1 = 4 + N
1 (as N
1 was equal to 1)
Now N
2 = 4 + N
1, what does 4 and N
2 have in common? Well 4 is 2
2! So what we have is
N
2 = 2
2 + N
1.
Now if we have 3 x 3 grid there would be 1 square of 3 x 3, 4 squares of 2 x 2 (you can count that) and 9 squares of 1 x 1 (you can also count that).
Therefore we have N
3 = 9 + 4 + 1, but we know that 1 is equal to N
1 and 4 = 2
2 so we get the this relationship
N
3 = 9 + 2
2 + N
1. Now we know that N
2 = 2
2 + N
1 So we can sub that in
N
3 = 9 + N
2 What do 9 and N
3 have in common? Well 9 = 3
2 so we get our final equation to be
N
3 = 3
2 + N
2Do you see a pattern?
The pattern is this
N
k = k
2 + N
k-1 Because of this we could expand this recursive relation
N
k = k
2 + (k - 1)
2 + (k - 2)
2 + .. + 2
2 + 1
So the final answer is this
The amount of squares for an N x N grid would be
1 + 4 + 9 + ... + (N - 1)
2 + N
2I did it in a more rigorous way that was required, but do you understand?