The South African Mathematical Olympiad
Third Round 2018
Senior Division (Grades 10 to 12)
Solutions
1. One hundred glasses are arranged in a 10 × 10 array. Now we pick a of the rows and pour blue
liquid into all glasses in these rows, so that they are half full. The remaining rows are filled
halfway with yellow liquid. Afterwards, we pick b of the columns and fill them up with blue
liquid. The remaining columns are filled up with yellow liquid. The mixture of blue and yellow
liquid turns green. If both halves in a glass have the same colour, then that colour remains as
it is.
(a) Determine all possible combinations of values for a and b so that exactly half of the
glasses contain green liquid at the end.
(b) Is it possible that precisely one quarter of the glasses contain green liquid at the end?
Solution: The total number of glasses that are green at the end of the procedure is
a(10 − b) + b(10 − a) = 10a + 10b − 2ab = 2(5a + 5b − ab).
We immediately observe that this number is always even, so the number of green glasses
cannot be 25 (i.e., one quarter). Hence the answer to the second question is no. For the first
question, we have to solve the equation
10a + 10b − 2ab = 50,
which is equivalent to
2ab − 10a − 10b + 50 = 2(a − 5)(b − 5) = 0.
Thus exactly half of the glasses contain green liquid if either a = 5 or b = 5 (and the other is
arbitrary).
2. In triangle ABC, AB = AC, and D is on BC. A point E is chosen on AC, and a point F is
DC AF
chosen on AB, such that DE = DC and DF = DB. It is given that = 2 and = 5.
BD AE
AB
Determine the value of .
BC
Solution: Note that triangles ABC and DF B are both isosceles, and they share the angle
at B. Therefore, they must be similar. Likewise, triangle DCE is similar to these two. Let
BF = x and BD = F D = y. Then we have DC = 2BD = 2y, and since DF B and DCE are
similar, it also follows that CE = 2x. Next, we let AB = AC = a, so AF = AB −BF = a−x
and AE = AC − CE = a − 2x. We are given that AF = 5AE, so
a − x = 5(a − 2x),
which is equivalent to 4a = 9x, i.e. a = 9x
4 . Finally, since ABC and DF B are similar, we
have
9x
4 AB BD y
= = = .
3y BC BF x
Thus y 2 3
= ,
x 4
and finally √
AB y 3
= = .
BC x 2
B D C
3. Determine the smallest positive integer n whose prime factors are all greater than 18, and that
can be expressed as n = a3 + b3 with positive integers a and b.
Solution: We can factorise n as
n = a3 + b3 = (a + b)(a2 − ab + b2 ).
The first factor a + b has to be at least 19, since n would otherwise contain a prime factor
that is smaller than 18. Setting a + b = s, we obtain
s 2 s2
a2 − ab + b2 = a2 − a(s − a) + (s − a)2 = 3a2 − 3as + s2 = 3 a −
2 + 4
2
by completing the square. Hence the second factor is greater or equal to s4 , and becomes
smaller the closer a is to 2s . If s = 19, then for a = 9 or a = 10, the second factor is 91 = 7·13,
which contains a prime factor smaller than 18. For a = 8 or a = 11, however, it is equal to
97, which is prime. In this case, n = 19 · 97 = 1843 = 113 + 83 satisfies the conditions.
If s = 19 and a < 8 or a > 11, then
19 2 ·192 3 2 192
a2 − ab + b2 = 3 a −
2 + 4 >3 2 + 4 = 97,
thus n > 19 · 97 = 1843. If s > 19, then s must be at least 20 (in fact at least 23, so that it
does not contain prime factors smaller than 18), so
2 2
2 3
n = s 3 a − 2s + s4 ≥ s · s4 ≥ 204 = 2000.
This means that 1843 is indeed the smallest number with the desired properties.
4. Let ABC be a triangle with circumradius R, and let `A , `B , `C be the altitudes through A, B, C
respectively. The altitudes meet at H. Let P be an arbitrary point in the same plane as ABC.
The feet of the perpendicular lines through P onto `A , `B , `C are D, E, F respectively. Prove
that the areas of DEF and ABC satisfy the following equation:
P H2
area(DEF ) = area(ABC).
4R2
Solution:
`C P D
`B
H
E C
B
`A
Note that ∠P DH = ∠P F H = ∠P EH = 90◦ by construction, so by Thales’s Theorem, D,
E and F lie on a circle whose diameter is P H. Therefore, the angle between lines DE and
F E is the same as the angle between lines DH and F H (angles subtended by the chord DF ),
which in turn is the same as the angle between lines AB and BC (angles between pairwise
perpendicular lines). Repeating the argument, we find that the angles between lines DE, DF ,
EF coincide with those between lines AB, AC, BC, so triangles ABC and DEF are similar.
The diameter of the circumcircle of ABC is 2R, the diameter of the circumcircle of DEF is
P H as observed before. Since areas of similar triangles are proportional to squared lengths,
we obtain
P H2
area(DEF ) = area(ABC)
4R2
as required.
5. Determine all sequences a1 , a2 , a3 , . . . of nonnegative integers such that a1 < a2 < a3 < · · ·
and an divides an−1 + n for all n ≥ 2.
Solution: We claim that the only possible sequences are the following:
• an = n − 1 for all n, or
n2 + n
• an = + k for all n, where k is a fixed nonnegative integer, or
2
(
n−1 n ≤ N,
• an = where N is a fixed nonnegative integer.
n2 +n N 2 −N +2
2 − 2 n > N,
Let us first verify that each of these sequences satifies the conditions:
• If an = n − 1 for all n, then an−1 + n = 2n − 2 = 2an is indeed divisible by an .
2 n2 −n n2 +n
• If an = n 2+n + k for all n, then an−1 + n = 2 +k+n = 2 + k = an is also
divisible by an .
• In the third case, an divides an−1 + n for n ≤ N as in the first case. Next note that
2 2
aN +1 = (N +1) 2+(N +1) − N −N 2
+2
= 2N divides aN + (N + 1) = 2N . Finally, for
n > N + 1, we have an = an−1 + n as in the second case, so an again divides an−1 + n.
Now we prove that these are the only such sequences. First, let ak be an element of the
sequence such that ak ≥ k (if such an element exists). Recall that ak + k + 1 has to be a
multiple of ak+1 . However, since ak+1 > ak , we have
2ak+1 ≥ 2(ak + 1) > 2ak + 1 ≥ ak + k + 1.
So the only possible multiple of ak+1 that ak + k + 1 could be is 1 · ak+1 , and it follows that
ak+1 = ak + k + 1. But then ak+1 ≥ k + k + 1 ≥ k + 1, so we can repeat the argument with
k + 1 instead of k to show that ak+2 = ak+1 + k + 2, etc. Generally, we get an+1 = an + n + 1
for all n ≥ k.
If a1 ≥ 1, then we can invoke this observation immediately: an+1 = an + n + 1 for all n ≥ 1,
so
n2 + n
an = an−1 + n = an−2 + (n − 1) + n = · · · = a1 + 2 + 3 + · · · + (n − 1) + n = + (a1 − 1),
2
which is exactly our second solution.
Suppose finally that a1 = 0, and let N be the largest index for which aN = N − 1; if there is
no largest index, then an = n − 1 for all n, and we obtain the first solution. Next note that
aN +1 has to divide aN + N + 1 = 2N . By our choice of N , we have aN +1 6= N , and since
aN +1 > aN = N −1, the only possible value (the only divisor of 2N ) for aN +1 is 2N . But then
aN +1 = 2N ≥ N + 1, and we can apply the same observation as before: am+1 = am + m + 1
for all m ≥ N , thus
an = an−1 + n = · · · = aN + (N + 1) + (N + 2) + · · · + (n − 1) + n =
n2 + n N 2 + N n2 + n N 2 − N + 2
= (N − 1) + − = −
2 2 2 2
for all n > N , which is indeed the third solution.
6. Let n be a positive integer, and let x1 , x2 , . . . , xn be distinct positive integers with x1 = 1.
Construct an n × 3 table where the entries of the k-th row are xk , 2xk , 3xk for k = 1, 2, . . . , n.
Now follow a procedure where, in each step, two identical entries are removed from the table.
This continues until there are no more identical entries in the table.
(a) Prove that at least three entries remain at the end of the procedure.
(b) Prove that there are infinitely many possible triples that can remain at the end of the
procedure for suitable choices of n and x1 , x2 , . . . , xn .
Solution:
(a) We write X as a shorthand for the set {x1 , x2 , . . . , xn }. Note that the number 1 can
only appear in the first row, so it remains at the end of the procedure. Next, let xk be
the largest power of 2 that occurs in X. This is possible since x1 = 1 is a power of 2.
The number 2xk in the second column of row k is a power of two, and it does not occur
in any of the other rows: it is not one of the numbers in the first column (i.e., one of the
other xj ) by our choice of xk , it is not anywhere else in the second column (i.e., equal to
2xj for some other j) since the xj are all distinct, and it is not in the third column (i.e.,
of the form 3xj ) since the numbers there are multiples of 3. Hence 2xk remains in the
table until the end of the procedure.
By the same argument, if we choose x` to be the largest power of 3 that occurs among
the numbers x1 , x2 , . . . , xn , then 3x` remains in the table at the end. Thus there are at
least three numbers left at the end, namely 1, 2xk , 3x` .
(b) We construct a sequence of sets Xr in the following way: X0 = {1}, and
r r
Xr+1 = Xr ∪ {22 x : x ∈ Xr } ∪ {32 x : x ∈ Xr }
r
for all r ≥ 0. In words: Xr+1 consists of Xr , all elements of Xr multiplied by 22 , and
r
all elements of Xr multiplied by 32 . We claim that the final table, if x1 , x2 , . . . , xn are
r r
chosen to be the elements of Xr , consists of the three numbers 1, 22 and 32 . Clearly,
this is true for r = 0: there is only one row, and the initial numbers 1, 2, 3 remain in the
table.
For the induction step, suppose the statement is true for Xr ; we prove it for Xr+1 . By
the induction hypotesis, we can perform the reduction procedure in such a way that the
r r
rows corresponding to Xr are reduced to 1, 22 and 32 . The rows corresponding to
r r r r r+1 r r r
{22 x : x ∈ Xr } can be reduced to 22 , 22 · 22 = 22 and 22 · 32 = 62 , and
r r r r r
the rows corresponding to {32 x : x ∈ Xr } can be reduced to 32 , 32 · 22 = 62 and
r r r+1 r r r
32 · 32 = 32 . Applying the reduction procedure three more times to 22 , 32 and 62 ,
r+1 r+1
we end up with the three numbers 1, 22 and 32 . This completes the induction and
thus the proof of the second part.