## Counting Squares

#### Problem

A standard chessboard measures 8 x 8 squares, making sixty-four 1 x 1 squares. But there are many more squares, for example 3 x 3, 4 x 4, etc.

How many squares are there altogether on a chessboard?

#### Solution

There are, 64 (1x1), 49 (2x2), 36 (3x3), 25 (4x4),

16 (5x5), 9 (6x6), 4 (7x7) and 1 (8x8) squares.

Making 1 + 4 + 9 + 16 + 25 + 36 + 49 + 64 = 204 squares in total.

How many squares are there on a `n` x `n` grid?

What about rectangles on an `m` x `n` grid?

Problem ID: 107 (Mar 2003) Difficulty: 1 Star