You are watching: Number of squares in a grid

Suppose $n\ge m$.Number the squares of dimension 1: $m\cdot n$Number that squares of size 2: $(m-1)\cdot (n-1)$...Number the squares of dimension m: $1\cdot (n-m+1)$

Result: $$\beginalign\sum_k=1^m k \cdot (n-m+k) & =(n-m)\sum_k=1^m k +\sum_k=1^m k^2 \\& = (n-m) m(m+1)/2 + m(m+1)(2m+1)/6 \\& = \fracm(m+1) (3n-m+1)6\endalign$$

Rectangles in rectangle$$\frac(n^2+n)(m^2+m)4$$

Rectangles in square$$\frac(n^2+n)^24$$

Squares in rectangle$$m≥ n-1,\frac(n^2+n)2m-\frac(n^3-n)6$$

Squares in square$$\frac(n^2+n)(2n+1)6$$

Thanks because that contributing response to barisalcity.orgematics ridge Exchange!

Please be certain to*answer the question*. Carry out details and share her research!

But *avoid* …

Use barisalcity.orgJax to style equations. Barisalcity.orgJax reference.

See more: Sears Roebuck And Co Pocket Watch 16, 2 Illinois Sears Roebuck Co

To learn more, see our advice on writing an excellent answers.

post Your prize Discard

By click “Post her Answer”, friend agree to our terms of service, privacy policy and also cookie plan

## Not the price you're feather for? Browse other questions tagged combinatorics or ask your own question.

What is the variety of squares in one $N\times M$ grid, if the squares don't need to be aligned with the grid's axes?

What is the number of squares in one $N\times M$ grid, if the squares don't have to be aligned v the grid's axes?

How plenty of subsets of squares in a $3 \times 3$ grid, corners requiring both adjacent squares to it is in included?

site style / logo design © 2021 stack Exchange Inc; user contributions license is granted under cc by-sa. Rev2021.10.14.40450

your privacy

By clicking “Accept all cookies”, you agree stack Exchange have the right to store cookies on your an equipment and disclose information in accordance with our Cookie Policy.