The squares of an board are coloured alternatingly black and white. A rectangle consisting of some of the squares of the board is called important if its sides are parallel to the sides of the board and all its corner squares are coloured black. The side lengths can be anything from to squares. On each of the squares of the board, we write the number of important rectangles in which it is contained. The sum of the numbers on black squares is , and the sum of the numbers on white squares is . Determine the difference .
Solution
In each important rectangle, the number of black squares is one more than the number of white squares. Hence, each important rectangle contributes to the difference . The value of is thus the same as the number of important rectangles on the board.
Let us number the rows on the board from the top downwards and the columns from the left to the right. So is the upper left square and denotes the lower right square. Assume is a black square. Then all with both and odd, as well as all those with both and even, are black squares. All other squares are white.
By focusing only on the four odd-numbered rows and the four odd-numbered columns, we find that they determine important rectangles. Similarly, the four even-numbered rows and the four even-numbered columns determine another important rectangles, giving a total of important rectangles on the board. It follows that .