Solution to the Problem:
The number of tiles that must be removed is given by the formula:
First examine several rooms and notice that the tiles to be removed form a triangular pattern. The squares with
red dots are the green tiles which must be removed and replaced with red tiles. These
numbers are called triangular numbers: 1, 3, 6, 10, 15, 21, ...
The formula for the nth triangular number is given below:
I noticed that the actual numbers for m and n are not as important as the ratio of m:n. For example, a 5 m by 5 m room with 1 m by 1 m tiles is
the same problem as a 15 m by 15 m room with 3 m by 3 m tiles. In each room, you would need to replace 4 tiles.
I organized this information into a table, I matched the values of m/n to the triangular numbers and developed the formulas for the number of tiles needed
on each side of the room (I used the formula above for the triangular numbers). Then I multiplied by four to get the total number of green tiles
that need to be removed.
The first column is
To get the second column, I matched each value of m/n to the nth triangular number and came up with this formula:
Then I used the formular to find the triangular number for the thrird column:
For the fourth column, I multiplied by four to get:
m / n
|
nth triangular #
|
Tiles on a side
|
Total tiles
|
3
|
0
|
0
|
0
|
5
|
1
|
1
|
4
|
7
|
2
|
3
|
12
|
9
|
3
|
6
|
24
|
11
|
4
|
10
|
40
|
13
|
5
|
15
|
60
|
15
|
6
|
21
|
84
|
17
|
7
|
28
|
112
|
Brijesh Dave sent in a simpler solution:
Total number of diagonal red tiles
is R = 2(m/n)-1
Total number of red tiles is
[(m/n)^2 + 1 ] / 2 after replacement of green tiles.
Total green tiles to be replaced is [(m/n)^2 + 1 ] / 2 - 2(m/n)+1 = [(m-2n)^2 - n^2] / 2n^2 which is same as the solution above of 1/2 (m/n-3)(m/n-1).
Colin Bowey sent in the same formula along with a spreadsheet so he gets extra credit for his spreadsheet
Click here to download the spreadsheet for any number of tiles up to m = 99.
Ritwik Chaudhuri also gets extra credit for his excellent solution: