Count how many squares connecting 4 points in this 6 x 6 grid one can draw.
(Bonus Generalization) Count how many squares connecting 4 points in an grid one can draw.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I found 105 squares in this grid.
First off - I am not certain I am correct. However, I know the problem is solvable. So a better solution is forthcoming from the community (wink). There are "level" as well as "tilted" squares. I partition the set of all squares S into subsets based on the slope of their edges.
S = S 0 + S 1 / 1 + S 1 / 2 + S 1 / 3 + S 1 / 4 + S 2 / 3
Squares have slopes a/b where a + b < = n and n is the number of squares along a side. In this case n = 5, which constrains the possible slopes that can fit on the grid.
I further partition each subset based on the scaling of the square. The smallest squares of a given type that fit on the grid are called 1x, the next scaling of that square are 2x, and so on...
S 0 : Slope 0 and undefined There are squares parallel/perpendicular with the edges of the grid. The edges of these squares have slope 0 and undefined.
S 0 1 x = one-by-one level squares ; for n = 5, S 0 1 x = 2 5 = 5 2
S 0 2 x = two-by-two level squares ; for n = 5, S 0 2 x = 1 6 = 4 2
S 0 3 x = three-by-three level squares ; for n = 5, S 0 3 x = 9 = 3 2
S 0 4 x = four-by-four level squares ; for n = 5, S 0 4 x = 4 = 2 2
S 0 5 x = five-by-five level squares ; for n = 5, S 0 5 x = 1 = 1 2
These squares follow a sum of squares pattern up to n .
∑ n = 1 n n 2 = 6 n ( n + 1 ) ( 2 n + 1 )
For n = 5 this sum is the total number of level squares and the first distractor, 55 .
S 1 / 1 : Slope 1/1 (a+b = 2) There are diamond-looking tilted squares with edges 45 degrees with the edges of the grid, or slopes 1/1 with scaling 1x and 2x fitting within this grid.
S 1 / 1 1 x = slope 1/1 squares ; for n = 5, S 1 / 1 1 x = 1 6 = 4 2
S 1 / 1 2 x = slope 2/2 squares ; for n = 5, S 1 / 1 2 x = 4 = 2 2
For n = 5 this sum is the total number of slope 1/1 tilted squares is 20 .
S 1 / 2 : Slope 1/2 (a+b = 3) There are tilted squares with slopes 1/2 and 2/1 with only scaling 1x fitting within this grid.
S 1 / 2 1 x = slope 1/2 squares ; for n = 5, S 1 / 2 1 x = 9 = 3 2
S 2 / 1 1 x = slope 2/1 squares ; for n = 5, S 2 / 1 1 x = 9 = 3 2
For n = 5 this sum is the total number of slope 1/2 tilted squares is 18 .
S 1 / 3 : Slope 1/3 (a+b = 4) There are tilted squares with slopes 1/3 and 3/1 with only scaling 1x fitting within this grid.
S 1 / 3 1 x = slope 1/3 squares ; for n = 5, S 1 / 3 1 x = 4 = 2 2
S 3 / 1 1 x = slope 3/1 squares ; for n = 5, S 3 / 1 1 x = 4 = 2 2
For n = 5 this sum is the total number of slope 1/3 tilted squares is 8 .
S 1 / 4 : Slope 1/4 (a+b = 5) There are tilted squares with slopes 1/4 and 4/1 with only scaling 1x fitting within this grid.
S 1 / 4 1 x = slope 1/4 squares ; for n = 5, S 1 / 4 1 x = 1 = 1 2
S 4 / 1 1 x = slope 4/1 squares ; for n = 5, S 2 / 1 1 x = 1 = 1 2
For n = 5 this sum is the total number of slope 1/4 tilted squares is 2 .
S 2 / 3 : Slope 2/3 (a+b = 5) There are tilted squares with slopes 2/3 and 3/2 with only scaling 1x fitting within this grid.
S 2 / 3 1 x = slope 2/3 squares ; for n = 5, S 2 / 3 1 x = 1 = 1 2
S 3 / 2 1 x = slope 3/2 squares ; for n = 5, S 3 / 2 1 x = 1 = 1 2
For n = 5 this sum is the total number of slope 1/2 tilted squares is 2 .
In general, it seems that the difference between the total of the slope a+b and n relates to the number of squares that fit in a given grid-size n. An explicit general rule eludes me.
kop _crush