Numbergrid

Ian66

New member
Joined
Feb 6, 2007
Messages
1
Hello guys, I've got a 10 by 10 number grid.

fc.PNG


How would I go about, calculating the products of the top left and bottom right, and then the top right and bottom left, values.

However I'm struggling creating an equation, to incorperate the grid length,the length of the box of which the numbers are in.

I've managed to do it when the length of the box is four.

x(x +g + 1) – (x + 1)(x + g)

x = top left hand number in the box.
g = grid length so in that picture 10.

However in the picture its 3, how would I add this variable box length into the equation?
 
Givens:
g = grid size (10 in your example)
x = box size (3 in your example)
a = value of top left in box (14 in your example)

Let b = top right in box, c = bottom left in box, d = bottom right in box

b = a + x - 1 : 14 + 3 - 1 = 16
c = a + g(x - 1) : 14 + 10(3 - 1) = 34
d = c + x - 1 : 34 + 3 - 1 = 36

products = ad and bc

Try a 12by12 grid, 5by5 box, 16 = top left:
b = 16 + 5 - 1 = 20
c = 16 + 12(5 - 1) = 64
d = 64 + 5 - 1 = 68

products = 16*68 = 1088 and 20*64 = 1280

You'll need to put in restrictions to prevent the box from going
outside the grid.
 
Since you'll probably ask anyway, general case formula:

g = grid size
x = box size
a = top left value
u = product top left and bottom right
v = product top right and bottom left

u = a^2 + a(g + 1)(x - 1)
v = u + g(x - 1)^2
where:
INT(a / g) + x =< g and a - g(INT(a / g)) + x - 1 =< g
 
Top