The Math Forum

Ask Dr. Math - Questions and Answers from our Archives
Associated Topics || Dr. Math Home || Search Dr. Math

Formula for Squares inside Rectangles

Date: 06/29/2003 at 09:48:23
From: Jamie
Subject: Number of Squares inside rectangles

Is there an equation for how many squares there are in a rectangle 
divided up into 1cm blocks? This is like the typical chessboard 

Date: 06/29/2003 at 10:50:49
From: Doctor Jaffee
Subject: Re: Number of Squares inside rectangles

Hi Jamie,

There is a formula that will calculate the number of squares in a 
rectangle. Here is how I found it.

First, let's consider only rectangles whose width is 1. 

A 1x1 rectangle contains exactly one square, a 1x2 rectangle contains 
two squares, a 1x3 rectangle contains three squares, etc.  In general, 
if the dimensions of a rectangle are 1xn, there will be n squares.

That was easy, and I probably haven't told you anything you didn't 
already know. 

Now let's consider rectangles whose width is 2, starting with a 2x2 
rectangle. We skip the 2x1 rectangle because we've already considered 
that in the previous case.  A 2x2 rectangle consists of four squares 
whose dimensions are 1x1 and one square whose dimensions are 2 x 2.  
This gives us a total of five squares. 

I'm going to create a table in which I list the width, length, number 
of 1x1 squares, number of 2x2 squares, and total number of squares.

   2 x 2     4    1     5
   2 x 3     6    2     8
   2 x 4     8    3    11
   2 x 5    10    4    14

In general, you should see that if you have a 2xn rectangle, the total 
number of squares will be 3n - 1.

I repeated this process for 3xn rectangles, 4xn rectangles, 5xn 
rectangles, until I recognized that there was a pattern developing.  
If the width is m and the length is n, I was able to write the total 
number of squares in terms of m and n.

Give it a try and if you want to check your answer with me or if you 
have difficulties or other questions, write back to me and I'll try to 
help you some more.

Good luck,

- Doctor Jaffee, The Math Forum 
Associated Topics:
High School Discrete Mathematics
High School Puzzles
Middle School Puzzles

Search the Dr. Math Library:

Find items containing (put spaces between keywords):
Click only once for faster results:

[ Choose "whole words" when searching for a word like age.]

all keywords, in any order at least one, that exact phrase
parts of words whole words

Submit your own question to Dr. Math

[Privacy Policy] [Terms of Use]

Math Forum Home || Math Library || Quick Reference || Math Forum Search

Ask Dr. MathTM
© 1994- The Math Forum at NCTM. All rights reserved.