Need a hint?

For the same grid of sixteen squares how many rectangles can be formed?
(remember that squares are rectangles)
Scroll down for the solution to the original problem.
Click here for the solution to the Challenge Problem
 
 
 
 
 
 
 
 
There is one large four-by-four square and there are 16 small one-by-one squares. There are also a number of two-by-two and three-by-three squares, but these are a little tricky to count since they overlap. One way to systematically keep track of these intermediate shapes is to note where the top left corners of these squares may lie. For example, the circles shown below are the top left corners of two possible 2 × 2 squares:

There are 16 one-by-one squares, 9 two-by-two squares (watch out! they overlap), 4 three-by-three squares, and 1 large four-by-four square, giving a total of 30 squares in all. It is curious that each count of squares of a particular size is itself a square number: 16 = 4², 9 = 3², 4 = 2², and 1 = 1². One can see why this is so by marking which intersections in the original grid serve as the top left corner of a square of a given size. For example, the diagram below shows nine points as the top left corner of a possible two-by-two square:
It is now clear why the count of two-by-two squares is three times three! Similarly, one can see why the count of three-by-three squares is two times two, or even why the count of one-by-one squares is four times four. The numbers 1, 4, 9, 16, 25, 36, … are called the “square numbers,” each being a number squared, and the total number of squares of any kind in a four-by-four array is the sum of the first four square numbers: 1 + 4 + 9 + 16 = 30.
 
If you attempted the Challenge Puzzle, click here for the solution and explanation.