# Number of squares and rectangles in a grid

After reading this you will be able to solve following type of problems:
• Total number of the squares in a square. For example, find number of square in a chess board
• Total number of the squares in a rectangle
• Total number of rectangles in a square
• Total number of rectangles in a rectangle

## How to find total number of squares in a rectangle

Formula to find number of squares in a square of size m*n =

= m*n + (m-1) * (n-1) + (m-2) * (n-2) +……………+ ( Stop when m or n become zero)

Example: Find the total no. of squares in a rectangle of 5*4

Total no of the squares in the 5*4 rectangle =
= (5*4) + (4*3) + (3*2) + (2*1)
= 20 + 12 + 6 + 2 = 40

Explanation:
No. of squares of 1*1 size = 5*4 = 20
No. of squares of 2*2 size = 4*3 = 12
No. of squares of 3*3 size = 3*2 = 6
No. of squares of 4*4 size = 2*1 = 2

So, Total Number of squares of 5*5 size =
= 20 + 12 + 6 + 2 = 40

Also know: How to find the unit digit when a number is raised to a large power using cyclicity of numbers

## How to find total number of squares in a square

We know that a square is nothing but a rectangle having length equal to breadth.
So, the method will be same here as of rectangle.

Now, you already know that Total number of squares in a rectangle of size m*n =
m*n + (m-1)*(n-1) + (m-2)* (n-2) + …………( stop when m or n become zero)

but, for square m = n

putting ‘n’ in place of ‘m’ in above formula, the formula become

= n*n + (n-1)*(n-1) + (n-2)* (n-2) + ……………….

So, Total number of squares in a square of size n*n =

= n2 + (n-1)2 + (n-2)2 +………………

Example: find the total no. of the squares in a Chess board

We all know that a chess board has dimension of 8*8, so we must find the total no. of squares in a square of 8*8.

Total no. of square in a square of 8*8 =

= 82 + 72 + 62 + 52 + 42 + 32 + 22 + 12 =
= 64+ 49 + 36 + 25 + 16 + 9 + 4 + 1 = 204

In more detail:

No. of squares of size 1*1 = 8*8 = 64
No. of squares of size 2*2 = 7*7 = 49
No. of squares of size 3*3 = 6*6 = 36
No. of squares of size 4*4 = 5*5 = 25
No. of squares of  size 5*5 = 4*4 = 16
No. of squares of size 6*6 = 3*3 = 9
No. of squares of size 7*7 = 2*2 = 4
No. of squares of size 8*8 = 1*1 = 1

So, Total number of squares in a chess board  =

= 64+ 49 + 36 + 25 + 16 + 9 + 4 + 1 = 204

### Total number of rectangles in a rectangle:

Formula Number of rectangles in a rectangle of size m*n = mc2 * nc2
Here, C represents combination.

If you don’t know permutation and combination, don’t worry remember the formula written below

Number of rectangles in a rectangle of size m*n =

= [m*(m+1)/2] * [n*(n+1)/2]

Example: find the total no. of the rectangle in a rectangle of 5*6

Solution: Total no. of rectangle in a rectangle of 5*6 =

= [5* (5+1)/2] * [6*(6+1)/2]
= [5*6/2] * [ 6*7/2]
= 15 * 21 = 315

### Total number of rectangles in a square:

A square is nothing but a rectangle having length equal to breadth.

So, the method will be same here as of rectangle,

We already know that Total no. of rectangle in a rectangle of size m*n
= [m*(m+1)/2] * [n*(n+1)/2]

but for square, m = n

putting ‘n’ in place of ‘m’ in above formula, the formula become

= [n*(n+1)/2] * [n*(n+1)/2] =  [n*(n+1)/2]2

So, Number of rectangles in a square of side length ‘n’ =

[n*(n+1)/2]2

Example: find the total no. of rectangles in a square having side length equal to 5.

Solution: [5*(5+1)/2]2 = [5*6/2]2
= 152 = 225.

#### Summary  If you like this post, share this content with your friends and most importantly don’t forget to subscribe so that you can get this type of amazing post directly into your email id.