Dif = (a+1)(a+9)-a(a+6) Dif = (a+1)(a+9)-a(a+8)
= 1²+1x5+1+5-1²-1x6 = 1²+1x7+1+7-1²-1x8
= 5 = 7
As soon as the size of the square is changed the rule does not work, although the difference is still a multiple of the grid width. I tested this theory using a 3x3 square and a 2x3 rectangle on a 6x6 number grid as follows:
I found similarities between the differences when looking at them written in different ways. For a 9x9 grid and different sized squares I got the following table of results:
This shows that the difference is relative to the grid width but increases as the size of the square increases in similar steps but faster and with more effect.
Using the formula I found that there is a pattern in the increase in difference of rectangles, such as 2x3, 3x4, etc… I have tabulated the results.
From looking at what I have tried I saw that in order to get a universal formula for the difference of any size square/rectangle on any size grid, both the grid width, width, and length of the square or rectangle would need to be used because they are essentially the changeables which effect each pattern and cause them to not work. Therefore I needed to find a connection.
To start with I used the width of the grid and width of square/rectangle together.
Where y is the box width and l is the grid width.
On testing the formula I found that it worked for any 2x2 square on any size grid.
For example, using the above formula:
Dif = 9(2-1)²
= 2²+2x9+2+9-2²-2x9-2
= 9
Dif = 18(2-1)²
= 2²+2x18+2+18-2²-2x18-2
= 18
The formula works if the box is always 2x2. I then tested the formula with a 3x3 square on a grid.
Dif = 9(3-1)²
= 3²+(3x9)+3+9-3²-(3x9)-3
= 9
I found this did not work.
Similar to the first formula but with width of square worked in instead of the top left number.
Therefore, for any square or rectangle with sides greater than 2 the variable sides need to be incorporated into the formula. I used the following notation to develop my theory:
By inserting these variables into my basic
formula above I developed the following
universal formula:
Using this formula I tested a square and rectangle on a 9x9 grid.
2x2 square on a 9x9 grid:
Dif = l(py-y-p+1)²
= lpy-ly-lp+l
= 2x2x9-2x9-2x9p+9
= 9
2x3 rectangle on a 9x9 grid:
Dif = l(py-y-p+1)²
= lpy-ly-lp+l
= 2x3x9-2x9-3x9p+9
= 18
The formula is…
(width of grid) x (area of square/rectangle) - (width of square/rectangle) - (height of square/rectangle) + (width of grid)
This gives the difference for any size square/rectangle on any size grid.
I tested the formula on a large random sized grid with a random sized rectangle.
3x9 rectangle on a 49x49 grid:
Dif = l(py-y-p+1)²
= lpy-ly-lp+l
= 3x9x49-3x49-9x49p+49
= 784
Conclusion: