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 …Asking for help, clarification, or responding to other answers.Making statements based upon opinion; earlier them increase with recommendations or an individual experience.
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
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