Today, Michael Fenton wrote a blog that posed the question “How many squares fit inside an m x n rectangle?”  Here is a link to Michael’s article:

How Many Squares?

And here is the solution to his problem:

where m and n are the lengths of the sides of the rectangle and f(m,n) is the number of squares that can fit inside the rectangle.

I found this solution here.

And here is something I designed to help experience the relationships described by this function.  Dragging the black dot allows you to create rectangles with different dimensions.  The number next to the dot expresses the number of squares that can fit inside that rectangle.

Playing with it for just a few minutes reveals tons of interesting and unexpected patterns and ideas for further exploration. What interesting patterns can you find? What new questions do you have after playing with it? I invite you to post them in the comments to further the discussion. Here’s one to get you started. A 4 x 3 rectangle produces 20 squares. A 4 x 21 rectangle produces 200 squares. Hmmm…