41+42+43+51+52+61 = 290
The formula works.
Proof Using a General Stair Shape
On a 10x10 grid:
There are 6 ns in this shape, and the
constants add up to 44, which also fits
in with my formula.
Different Sized Grids
I am going to continue this investigation on different sized grids. I shall use ‘g’ to represent grid size. I cannot use multiples of g, or multiples of g-1 as my s-number with a three step stair, as the shape won’t fit on the grid otherwise.
I will investigate, changing two variables – Grid Size and S-number. I will record results in the following grid:
Grid Size | S number | S Total
8 | 1 | 46
8 | 2 | 52
9 | 1 | 54
9 | 2 | 60
11 | 1 | 42
11 | 2 | 48
From these results I can determine the following general stair shape:
From which, in turn, I can determine the following formula:
S= 6n +4g +4
This is because there are 6 ns in my shape, 4 gs in my shape, and a 4 in my shape.
I will test this with an 11x11 grid, using an s number of 49. These values were chosen arbitrarily.
(6x49) + (4x11) + 4 = 342
49+50+51+60+61+71 = 342
My formula works!
Different Sized Stairs
I now plan on working out a formula which includes the size of the stair. Let h be the stair size. On a 10x10 grid:
2x2 S total = 14 S=3n+g+1
3x3 S total= 50 S=3n+g+1
4x4 S total = 120 S=3n+g+1
5x5 S total = 235 S=3n+g+1
6x6 S total = 406 S=3n+g+1
Length | Formula _
h=1 | S= n +0g +0
h=2 | S= 3n +g +1
h=3 | S= 6n +4g +4
h=4 | S= 10n +10g +10
h=5 | S= 15n +20g +20
h=6 | S= 21n +35g +35
I can see that the coefficient of n is going up in triangle numbers (1, 3, 6, 10…). I can also see that the difference in the constant (and the coefficient of g, as they are identical) is going up in triangle numbers (i.e. 0+1, 1+3, 4+6, 10+10…).
The value of n is easy to get – simply add up the first h numbers. ( ∑ i).
The value of the constant however, is harder to get. I need to add up the first h-1 triangle numbers to get it. Seeing as the formula for triangle numbers is n(n+1) , the constant = .
2
By combining these elements, I get the following formula:
S= h(h +1) + g +
2
Simplification
Unfortunately, this needs simplifying.
can be split up into two parts to make it easier to simplify:
(∑ i2 + ∑ i) 2
This can be turned into this:
½ ( (h-1((h-1)+1)(2(h-1)+1)) + (h-1((h-1)+1)) ) = g
6 2
½ ( (h-1((h-1)+1)(2(h-1)+1)) + 3(h-1((h-1)+1)) ) =6g
½ ( (h-1)(h(2h -1)) + 3(h2+h) ) =6g
½ ( (h-1)(2h2 -h) + 3h2+3h ) =6g
½ ( 2h3 –h2 -2h2 +h + 3h2+3h ) =6g
½ (2h3 -2h) =6g
h3 –h = g
Final Formula!
I have reached a formula for the coefficient of g, which can also be used for the constant. I now have all the components of a general formula for a stair shape of size h on a g x g grid with a stair number of n to work out the total of the sum of the numbers in the shape (S):
S= h(h+1) h3-h h3-h
2 6 6
I can now test this formula when
n= 25
g= 11
h= 7
7(7+1) x25 + 73-7 x11 + 73-7 = 1372
2 6 6
25+26+27+28+29+30+31+36+37+38+39+
40+41+47+48+49+50+ 51+58+59+60+61+
69+70+71+80+81+91 = 1372
Notes
The reason the constant is always the same as the coefficient of g is that the same things happen to the both of them, although perpendicular to each other, as illustrated by this diagram:
For every row added on, an equal amount of g and of the constant is added on.
Limitations
There are some limitations to this formula, as there are some limitations to the placement of the staircase. For example, the staircase cannot be larger than the grid, else it wouldn’t all fit. The coefficient of n is also limited, or the staircase wouldn’t entirely fit on the grid. To create a formula to determine where n is allowed to be, I need to introduce a new variable – r for the row that n is on.
I need to eliminate the top few rows as possible locations for n (depending on the size of the staircase):
n< g2- g(h-1)
I also need to eliminate a few columns on the right as possible locations for n (depending on the size of the staircase):
n< rg -(h-1)