Susan made a 4x4 grid of squares, being a 5x5 grid of horizontal and vertical lines. If you figure it out, you can see there are 100 rectangles that can be made out from portions of those vertical and horizontal lines.

Susan then made a much larger such square grid. The number of little squares in it was a 3-digit number. She calculated how many rectangles of all sizes and shapes were thus formed on that new grid. She then cut along one of the straight lines of the grid to make two rectangular grids. Then she calculated the total number of rectangles in each of the two new pieces. It turned out that the total of these two numbers was exactly two thirds of the number visible on the original large square grid from which the two were cut.

What was the size of the original large grid before she cut it, and how far away from an edge did she cut it?

Bonus:

Are there any smaller grids for which this is possible?

The formula for the number of subrectangles in a m by n rectangle is (m*n*(m+1)*(n+1))/4.

Let the side of the original square be x+y where x and y are the lengths that the square gets cut into.

The original square will have ((x+y)*(x+y)*(x+y+1)*(x+y+1))/4 subrectangles.

After cutting, the two rectangles [x by x+y and y by x+y] will have a combined total of (x*(x+y)*(x+1)*(x+y+1))/4 + (y*(x+y)*(y+1)*(x+y+1))/4 subrectangles.

Using the 2/3 ratio given in the problem, the following equation can be formed:

(2/3)*((x+y)*(x+y)*(x+y+1)*(x+y+1))/4 = (x*(x+y)*(x+1)*(x+y+1))/4 + (y*(x+y)*(y+1)*(x+y+1))/4

Multiplying each side by 12/((x+y)*(x+y+1)) yields:

2*(x+y)*(x+y+1) = 3*(x*(x+1) + y*(y+1))

Rearranging this equation yields:

x^2 + (1-4y)x + (y^2+y) = 0

Using the quadratic formula gives:

x = (4y-1 +/- sqrt[12y^2-12y+1])/2

Testing values of y from 1 to 100 gives the following integer results:

y=1 -> x=1,2

y=2 -> x=1,6

y=6 -> x=2,21

y=21 -> x=6,77

y=77 -> x=21,286

The problem stated the number of small squares was a three digit number which means 999 >= (x+y)^2 >= 100, or equivalently 32 > x+y >= 10. The only x,y pair which satisfies the inequality is 6,21. Therefore the original square had a side length of 27 and was cut into rectangles of 6 by 27 and 21 by 27.

Taking the values of x and y in a sequence gives 1, 1, 2, 6, 21, 77, 286, . . . Any two consecutive terms in this sequence can be used as values for x and y. That gives three possibilities for smaller squares: 1+1=2, 1+2=3, 2+6=8. This sequence can be extended infinitely using the recursion t(n) = 4*t(n-1) - t(n-2) - 1.

*Edited on ***August 7, 2007, 2:27 pm**