China PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 95

Mathematics Olympiad Coachs Seminar, Zhuhai, China 1

03/22/2004

Algebra
1. There exists a polynomial P of degree 5 with the following property: if z is a complex number such
that z 5 + 2004z = 1, then P (z 2 ) = 0. Find all such polynomials P .

2. Let N denote the set of positive integers. Find all functions f : N → N such that

f (m + n)f (m − n) = f (m2 )

for all m, n ∈ N.

Solution: Function f (n) = 1, for all n ∈ N, is the only function satisfying the conditions of
the problem.
Note that
f (1)f (2n − 1) = f (n2 ) and f (3)f (2n − 1) = f ((n + 1)2 )
for n ≥ 3. Thus
f (3) f ((n + 1)2 )
= .
f (1) f (n2 )
f (3)
Setting f (1) = k yields f (n2 ) = k n−3 f (9) for n ≥ 3. Similarly, for all h ≥ 1,

f (h + 2) f ((m + 1)2 )
=
f (h) f (m2 )

for sufficiently large m and is thus also k. Hence f (2h) = k h−1 f (2) and f (2h + 1) = k h f (1).
But
f (25) f (25) f (11)
= · ··· · = k8
f (9) f (23) f (9)
and
f (25) f (25) f (16)
= · = k2 ,
f (9) f (16) f (9)
so k = 1 and f (16) = f (9). This implies that f (2h + 1) = f (1) = f (2) = f (2j) for all j, h, so f is
constant. From the original functional equation it is then clear that f (n) = 1 for all n ∈ N.

3. Call a real-valued function f very convex if


µ ¶
f (x) + f (y) x+y
≥f + |x − y|
2 2

holds for all real numbers x and y. Prove that no very convex function exists.

First Solution: Fix n ≥ 1. For each integer i, define


µ ¶ µ ¶
i+1 i
∆i = f −f .
n n
2 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

The given inequality with x = (i + 2)/n and y = i/n implies


¡ i+2 ¢ ¡i¢ µ ¶
f n +f n i+1 2
≥f + ,
2 n n

from which,
µ ¶ µ ¶ µ ¶ µ ¶
i+2 i+1 i+1 i 4
f −f ≥f −f + ,
n n n n n
that is, ∆i+1 ≥ ∆i + 4/n. Combining this for n consecutive values of i gives ∆i+n ≥ ∆i + 4. Summing
this inequality for i = 0 to i = n − 1 and cancelling terms yields

f (2) − f (1) ≥ f (1) − f (0) + 4n.

This cannot hold for all n ≥ 1. Hence there are no very convex functions.

Second Solution: We show by induction that the given inequality implies


µ ¶
f (x) + f (y) x+y
−f ≥ 2n |x − y|
2 2

for all nonnegative integers n. This will yield a contradiction, because for fixed x and y the right side
gets arbitrarily large, while the left side remains fixed.
We are given the base case n = 0. Now if the inequality holds for a given n, then for a, b real,

f (a) + f (a + 2b)
≥ f (a + b) + 2n+1 |b|,
2
f (a + b) + f (a + 3b) ≥ 2(f (a + 2b) + 2n+1 |b|),

and
f (a + 2b) + f (a + 4b)
≥ f (a + 3b) + 2n+1 |b|.
2
Adding these three inequalities and canceling terms yields

f (a) + f (a + 4b)
≥ f (a + 2b) + 2n+3 |b|.
2

Setting x = a, y = a + 4b, we obtain


µ ¶
f (x) + f (y) x+y
≥f + 2n+1 |x − y|,
2 2

and the induction is complete.

Third Solution: Rewrite the condition as


µ ¶ µ ¶
x+y x+y
f (x) − f ≥f − f (y) + 2|x − y|.
2 2
Mathematics Olympiad Coachs Seminar, Zhuhai, China 3

For any positive integer n,

f (1) − f (0) = f (1) − f (1/2) + f (1/2) − f (0)


≥ f (1/2) − f (0) + 2 + f (1/2) − f (0)
= 2[f (1/2) − f (0)] + 2
= 2[f (1/2) − f (1/4) + f (1/4) − f (0)] + 2
≥ 2[f (1/4) − f (0) + 1 + f (1/4) − f (0)] + 2
= 4[f (1/4) − f (0)] + 4 = · · · ≥ 2n [f (1/2n ) − f (0)] + 2n.

Similarly, f (−1) − f (0) ≥ 2n [f (−1/2n ) − f (0)] + 2n. But

f (1/2n ) + f (−1/2n ) ≥ 2f (0) + 1/2n−2 > 2f (0).

Thus, for each n, at least one of f (1/2n ) − f (0) and f (−1/2n ) − f (0) is greater than 0. It follows
that at least one of f (1) − f (0) and f (−1) − f (0) is greater than 2n for all n ≥ 1, which is impossible.
Hence there is no very convex functions.

4. Let a1 , a2 , . . . , an (n > 3) be real numbers such that

a1 + a2 + · · · + an ≥ n and a21 + a22 + · · · + a2n ≥ n2 .

Prove that max(a1 , a2 , . . . , an ) ≥ 2.

P P
Solution: Let bi = 2 − ai , and let S = bi and T = b2i . Then the given conditions are
that
(2 − a1 ) + · · · + (2 − an ) ≥ n
and
(4 − 4b1 + b21 ) + · · · + (4 − 4bn + b2n ) ≥ n2 ,
which is to say S ≤ n and T ≥ n2 − 4n + 4S.
From these inequalities, we obtain

T ≥ n2 − 4n + 4S ≥ (n − 4)S + 4S = nS.
P
On the other hand, if bi > 0 for i = 1, . . . , n, then certainly bi < bi = S ≤ n, and so

T = b21 + · · · + b2n < nb1 + · · · + nbn = nS.

Thus we cannot have bi > 0 for i = 1, . . . , n, so bi ≤ 0 for some i, and ai ≥ 2 for that i, proving the
claim.

Note: The statement is false when n ≤ 3. The example a1 = a2 = · · · = an−1 = 2, an = 2 − n


shows
P that the Pbound cannot be improved. An alternate approach is to show that if ai ≤ 2 and
ai ≥ n, then a2i ≤ n2 (with the equality case just mentioned), by noticing that replacing a pair
ai , aj with 2, ai + aj − 2 increases the sum of squares.
1
5. Let { an }n≥0 be a sequence of real numbers such that an+1 ≥ a2n + for all n ≥ 0. Prove that
√ 5
an+5 ≥ a2n−5 for all n ≥ 5.
4 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

First Solution: (by Alison Miller) For any k, we have the following inequality:
1 1 1 1
ak+1 + ≥ a2k + + = a2k + ≥ ak ,
20 5 20 4
because (ak − 12 )2 ≥ 0. Summing up this inequalities over k = n + 1, . . . , n + 4, we have

1 1
an+5 + ≥ an+1 ≥ a2n + ,
5 5
and similarly an ≥ a2n−5 , so
an+5 ≥ a2n ≥ a4n−5 ,
implying the desired result.

6. Prove that the average of the numbers n sin n◦ (n = 2, 4, 6, . . . , 180) is cot 1◦ .

Solution: All arguments of trigonometric functions will be in degrees. We need to prove

2 sin 2 + 4 sin 4 + · · · + 178 sin 178 = 90 cot 1, (∗)

which is equivalent to

2 sin 2 · sin 1 + 2(2 sin 4 · sin 1) + · · · + 89(2 sin 178 · sin 1) = 90 cos 1.

Using the identity 2 sin a · sin b = cos(a − b) − cos(a + b), we find

2 sin 2 · sin 1 + 2(2 sin 4 · sin 1) + · · · + 89(2 sin 178 · sin 1)


= (cos 1 − cos 3) + 2(cos 3 − cos 5) + · · · + 89(cos 177 − cos 179)
= cos 1 + cos 3 + cos 5 + · · · + cos 175 + cos 177 − 89 cos 179
= cos 1 + (cos 3 + cos 177) + · · · + (cos 89 + cos 91) − 89 cos 179
= cos 1 + 89 cos 1 = 90 cos 1,

so (∗) is true.

7. Let a, b, c be real numbers in the interval (0, π2 ). Prove that

sin a sin(a − b) sin(a − c) sin b sin(b − c) sin(b − a) sin c sin(c − a) sin(c − b)


+ + ≥ 0.
sin(b + c) sin(c + a) sin(a + b)

Solution: By the Product-to-sum formulas and the Double-angle formulas, we have


1
sin(α − β) sin(α + β) = [cos 2β − cos 2α]
2
= sin2 α − sin2 β.

Hence, we obtain

sin a sin(a − b) sin(a − c) sin(a + b) sin(a + c)


= sin c(sin2 a − sin2 b)(sin2 a − sin2 c)
Mathematics Olympiad Coachs Seminar, Zhuhai, China 5

and its analogous forms. Therefore, it suffices to prove that

x(x2 − y 2 )(x2 − z 2 ) + y(y 2 − z 2 )(y 2 − x2 ) + z(z 2 − x2 )(z 2 − y 2 ) ≥ 0,

where x = sin a, y = sin b, and z = sin c (hence x, y, z > 0). Since the last inequality is symmetric
with respect to x, y, z, we may assume that x ≥ y ≥ z > 0. It suffices to prove that

x(y 2 − x2 )(z 2 − x2 ) + z(z 2 − x2 )(z 2 − y 2 ) ≥ y(z 2 − y 2 )(y 2 − x2 ),

which is evident as
x(y 2 − x2 )(z 2 − x2 ) ≥ 0
and
z(z 2 − x2 )(z 2 − y 2 ) ≥ z(y 2 − x2 )(z 2 − y 2 ) ≥ y(z 2 − y 2 )(y 2 − x2 ).

Note: The key step of the proof is an instance of Schur’s Inequality with r = 21 .

8. Let ABC be a triangle. Prove that


3A 3B 3C A−B B−C C −A
sin + sin + sin ≤ cos + cos + cos .
2 2 2 2 2 2

First Solution: Let α = A2 , β = B2 , γ = C2 . Then 0◦ < α, β, γ < 90◦ and α + β + γ = 90◦ .


By the Difference to Product formulas, we have
3A B−C
sin − cos = sin 3α − cos(β − γ)
2 2
= sin 3α − sin(α + 2γ)
= 2 cos(2α + γ) sin(α − γ)
= −2 sin(α − β) sin(α − γ).

In exactly the same way, we can show that


3B C −A
sin − cos = −2 sin(β − α) sin(β − γ)
2 2
and
3C A−B
sin− cos = −2 sin(γ − α) sin(γ − β).
2 2
Hence it suffices to prove that

sin(α − β) sin(α − γ) + sin(β − α) sin(β − γ)


+ sin(γ − α) sin(γ − β) ≥ 0.

Note that this inequality is symmetric with respect to α, β, γ, so we can assume without loss of
generality that 0◦ < α < β < γ < 90◦ . Then regrouping the terms on the left-hand side gives

sin(α − β) sin(α − γ) + sin(γ − β)[sin(γ − α) − sin(β − α)],

which is positive because the function y = sin x is increasing for 0◦ < x < 90◦ .
6 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Note: This proof is similar to that of the Schur’s Inequality.

Second Solution: We keep the notation of the first solution. By the Addition formulas,
we have

sin 3α = sin α cos 2α + sin 2α cos α;


cos(β − α) = sin(2α + γ) = sin 2α cos γ + sin γ cos 2α;
cos(β − γ) = sin(2γ + α) = sin 2γ cos α + sin α cos 2γ;
sin 3γ = sin γ cos 2γ + sin 2γ cos γ.

By the Difference to Product formulas, it follows that

sin 3α + sin 3γ − cos(β − α) − cos(β − γ)


= (sin α − sin γ)(cos 2α − cos 2γ)
+(cos α − cos γ)(sin 2α − sin 2γ)
= (sin α − sin γ)(cos 2α − cos 2γ)
+2(cos α − cos γ) cos(α + γ) sin(α − γ).

Note that sin x is increasing, cos x and cos(2x) are decreasing for 0 < x < 90◦ . Since 0 < α, γ, α +γ <
90◦ , each of the two products in the last addition is less than or equal to 0. Hence

sin 3α + sin 3γ − cos(β − α) − cos(β − γ) ≤ 0.

In exactly the same way, we can show that

sin 3β + sin 3α − cos(γ − β) − cos(γ − α) ≤ 0

and
sin 3γ + sin 3β − cos(α − γ) − cos(α − β) ≤ 0.

Adding the last three inequalities gives the desired result.

9. Let a, b, c be positive real numbers. Prove that

(2a + b + c)2 (2b + c + a)2 (2c + a + b)2


+ + ≤ 8.
2a2 + (b + c)2 2b2 + (c + a)2 2c2 + (a + b)2

First Solution: (Based on work by Matthew Tang and Anders Kaseorg) By multiplying a, b,
and c by a suitable factor, we reduce the problem to the case when a + b + c = 3. The desired
inequality reads
(a + 3)2 (b + 3)2 (c + 3)2
+ + ≤ 8.
2a2 + (3 − a)2 2b2 + (3 − b)2 2c2 + (3 − c)2
Set
(x + 3)2
f (x) =
2x2 + (3 − x)2
Mathematics Olympiad Coachs Seminar, Zhuhai, China 7

It suffices to prove that f (a) + f (b) + f (c) ≤ 8. Note that


x2 + 6x + 9 1 x2 + 6x + 9
f (x) = = ·
3(x2 − 2x + 3) 3 x2 − 2x + 3
µ ¶ µ ¶
1 8x + 6 1 8x + 6
= 1+ 2 = 1+
3 x − 2x + 3 3 (x − 1)2 + 2
µ ¶
1 8x + 6 1
≤ 1+ = (4x + 4).
3 2 3
Hence,
1
f (a) + f (b) + f (c) ≤ (4a + 4 + 4b + 4 + 4c + 4) = 8,
3
as desired, with equality if and only if a = b = c.

Second Solution: (By Liang Qin) Setting x = a + b, y = b + c, z = c + a gives 2a + b + c = x + z,


hence 2a = x + z − y and their analogous forms. The desired inequality becomes
2(x + z)2 2(z + y)2
+
(x + z − y)2 + 2y 2 (z + y − x)2 + 2x2
2(y + x)2
+ ≤ 8.
(y + x − z)2 + 2z 2
Because 2(s2 +t2 ) ≥ (s+t)2 for all real numbers s and t, we have 2(x+z −y)2 +2y 2 ≥ (x+z −y+y)2 =
(x + z)2 . Hence
2(x + z)2
(x + z − y)2 + 2y 2
4(x + z)2 4(x + z)2
= ≤
2(x + z − y)2 + 4y 2 (x + z)2 + 2y 2
4 4 4(x2 + z 2 )
= ≤ = .
y 2
1 + 2 · (x+z) 2
2
1 + 2 · 2(x2y+z 2 ) x2 + y 2 + z 2

It is not difficult to see that the desired result follows from summing up the above inequality and its
analogous forms.

Third Solution: (By Richard Stong) Note that

(2x + y)2 + 2(x − y)2 = 4x2 + 4xy + y 2 + 2x2 − 4xy + 2y 2


= 3(2x2 + y 2 ).

Setting x = a and y = b + c yields

(2a + b + c)2 + 2(a − b − c)2 = 3(2a2 + (b + c)2 ).

Thus, we have
(2a + b + c)2 3(2a2 + (b + c)2 ) − 2(a − b − c)2
=
2a2 + (b + c)2 2a2 + (b + c)2
2(a − b − c)2
= 3− 2 .
2a + (b + c)2
8 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

and its analogous forms. Thus, the desired inequality is equivalent to


(a − b − c)2 (b − a − c)2 (c − a − b)2 1
2 2
+ 2 2
+ 2 2
≥ .
2a + (b + c) 2b + (c + a) 2c + (a + b) 2

Because (b + c)2 ≤ 2(b2 + c2 ), we have 2a2 + (b + c)2 ≤ 2(a2 + b2 + c2 ) and its analogous forms. It
suffices to show that
(a − b − c)2 (b − a − c)2 (c − a − b)2 1
+ + ≥ ,
2(a2 + b2 + c2 ) 2(a2 + b2 + c2 ) 2(a2 + b2 + c2 ) 2
or,
(a − b − c)2 + (b − a − c)2 + (c − a − b)2 ≥ a2 + b2 + c2 .
Multiplying this out, the left-hand side of the last inequality becomes 3(a2 + b2 + c2 ) − 2(ab + bc + ca).
Therefore the last inequality is equivalent to 2[a2 + b2 + c2 − (ab + bc + ca)] ≥ 0, which is evident
because
2[a2 + b2 + c2 − (ab + bc + ca)] = (a − b)2 + (b − c)2 + (c − a)2 .
Equalities hold if and only if (b + c)2 = 2(b2 + c2 ) and (c + a)2 = 2(c2 + a2 ), that is, a = b = c.

Fourth Solution: We first convert the inequality into


2a(a + 2b + 2c) 2b(b + 2c + 2a) 2c(c + 2a + 2b)
+ + ≤ 5.
2a2 + (b + c)2 2b2 + (c + a)2 2c2 + (a + b)2
Splitting the 5 among the three terms yields the equivalent form
X 4a2 − 12a(b + c) + 5(b + c)2
≥ 0, (1)
cyc
3[2a2 + (b + c)2 ]
P
where cyc is the cyclic sum of variables (a, b, c). The numerator of the term shown factors as
(2a − x)(2a − 5x), where x = b + c. We will show that
(2a − x)(2a − 5x) 4(2a − x)
2 2
≥− . (2)
3(2a + x ) 3(a + x)
Indeed, (2) is equivalent to

(2a − x)[(2a − 5x)(a + x) + 4(2a2 + x2 )] ≥ 0,

which reduces to
(2a − x)(10a2 − 3ax − x2 ) = (2a − x)2 (5a + x) ≥ 0,
which is evident. We proved that
4a2 − 12a(b + c) + 5(b + c)2 4(2a − b − c)
2 2
≥− ,
3[2a + (b + c) ] 3(a + b + c)
hence (1) follows. Equality holds if and only if 2a = b + c, 2b = c + a, 2c = a + b, i.e., when a = b = c.

Fifth Solution: Given a function f of n variables, we define the symmetric sum


X X
f (x1 , . . . , xn ) = f (xσ(1) , . . . , xσ(n) )
sym σ
Mathematics Olympiad Coachs Seminar, Zhuhai, China 9

where σ runs over all permutations of 1, . . . , n (for a total of n! terms). For example, if n = 3, and
we write x, y, z for x1 , x2 , x3 ,
X
x3 = 2x3 + 2y 3 + 2z 3
sym
X
x2 y = x2 y + y 2 z + z 2 x + x2 z + y 2 x + z 2 y
sym
X
xyz = 6xyz.
sym

We combine the terms in the desired inequality over a common denominator and use symmetric sum
notation to simplify the algebra. The numerator of the difference between the two sides is
X
2 4a6 + 4a5 b + a4 b2 + 5a4 bc + 5a3 b3 − 26a3 b2 c + 7a2 b2 c2 , (3)
sym

and it suffices to show the the expression in (3) is always greater or equal to 0. By the Weighted
AM-GM Inequality, we have 4a6 + b6 + c6 ≥ 6a4 bc, 3a5 b + 3a5 c + b5 a + c5 a ≥ 8a4 bc, and their
analogous forms. Adding those inequalities yields
X X X X
6a6 ≥ 6a4 bc and 8a5 b ≥ 8a4 bc.
sym sym sym sym

Consequently, we obtain
X X
4a6 + 4a5 b + 5a4 bc ≥ 13a4 bc. (4)
sym sym
Again by the AM-GM Inequality, we have a4 b2 + b4 c2 + c4 a2 ≥ 4a2 b2 c2 , a3 b3 + b3 c3 + c3 a3 ≥ 3a2 b2 c2 ,
and their analogous forms. Thus,
X X
a4 b2 + 5a3 b3 ≥ 6a2 b2 c2 ,
sym sym
or X X
a4 b2 + 5a3 b3 + 7a2 b2 c2 ≥ 13a2 b2 c2 . (5)
sym sym
Recalling Schur’s Inequality, we have

a3 + b3 + c3 + 3abc − (a2 b + b2 c + c2 a + ab2 + bc2 + ca2 )


= a(a − b)(a − c) + b(b − a)(b − c) + c(c − a)(c − b) ≥ 0,

or X
a3 − 2a2 b + abc ≥ 0.
sym
Thus X X
13a4 bc − 26a3 b2 c + 13a2 b2 c2 ≥ 13abc a3 − 2a2 b + abc ≥ 0. (6)
sym sym
Adding (4), (5), (6) yields (3).
10 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Note: While the last two methods seem inefficient for this problem, they hold the keys to proving
the following inequality:

(b + c − a)2 (c + a − b)2 (a + b − c)2 3


+ + ≥ ,
(b + c)2 + a2 (c + a)2 + b2 (a + b)2 + c2 5

where a, b, c are positive real numbers.

10. Let a, b, c be nonnegative real numbers. Prove that

a+b+c √ √ √ √ √ √ √
− abc ≤ max{( a − b)2 , ( b − c)2 , ( c − a)2 }.
3

First Solution: We prove the stronger inequality


√ √ √ √ √ √ √
a + b + c − 3 abc ≤ ( a − b)2 + ( b − c)2 + ( c − a)2 .
3
(1)

The conclusion is immediate if abc = 0, so we assume that a, b, c > 0. By multiplying a, b, c by a


suitable factor, we may reduce to the case abc = 1. Without loss of generality, assume that a and
b are both greater than or equal to 1, or both less than or equal to 1. The desired inequality now
becomes
√ √ √
0 ≤ a + b + c − 2 ab − 2 bc − 2 ca + 3
√ √ 1 2 2
= ( a − b)2 + − √ − √ +3
ab a b
µ ¶2 µ ¶2
√ √ 2 1 1
= ( a − b) + √ − 1 + √ − 1
a b
1 1 1
+ − − +1
ab a b
µ ¶2 µ ¶2
√ √ 2 1 1
= ( a − b) + √ − 1 + √ − 1
a b
µ ¶µ ¶
1 1
+ −1 −1 .
a b

Second Solution: (by Ian Le) We again prove the stronger inequality (1), which can be rewritten
X
[a − 2(ab)1/2 + (abc)1/3 ] ≥ 0,
sym

where the sum is taken over all six permutations of a, b, c. This inequality follows from adding the
two inequalities X
[a − 2a2/3 b1/3 + (abc)1/3 ] ≥ 0
sym
and X
[a2/3 b1/3 + a1/3 b2/3 − 2a1/2 b1/2 ] ≥ 0.
sym
Mathematics Olympiad Coachs Seminar, Zhuhai, China 11

The first of these is the Schur’s inequality with x = a1/3 , y = b1/3 , z = c1/3 , while the second
follows from the AM-GM inequality.

Third Solution: Without loss of generality, assume that b is between a and c. The desired
inequality reads √ √
3
a + b + c − 3 abc ≤ 3(c + a − 2 ac).
As a function of b, the right side minus the left side is concave (its second derivative is −(2/3)(ac)1/3 b−5/3 ),
so its minimum value in the range [a, c] occurs at one of the endpoints. Thus, without loss of gener-
ality, we may assume a = b. Moreover, we may rescale the variables to get a = b = 1. Now the claim
reads
2c + 3c1/3 + 1
≥ c1/2 .
6
This is an instance of weighted AM-GM inequality.

Note: More generally, for nonnegative real numbers a1 , a2 , . . . , an , we have


m a1 + a2 + · · · + an √ (n − 1)M
≤ − n a1 a2 · · · an ≤ , (2)
2 n 2
where
√ √ √ √
m= min {( ai − aj )2 } and M = max {( ai − aj )2 }.
1≤i<j≤n 1≤i<j≤n

The right inequality can be proved, by using the method of the third solution above. We leave the
details as an exercise for the reader.
√ √
The left inequality falls apart when we replace m by c, the average of ( ai − aj )2 for 1 ≤ i < j ≤ n.
Since
P √ √ 2
m c 1≤i<j≤n ( ai − aj )
≤ = ¡ ¢
2 2 2 n2
P √ √ 2
1≤i<j≤n ( ai − aj )
=
n(n − 1)
P √
(n − 1)(a1 + a2 + · · · + an ) − 2 1≤i<j≤n ai aj
= ,
n(n − 1)
the inequality now reads √
X √ n(n − 1) n a1 a2 · · · an
ai aj ≥ .
2
1≤i<j≤n

This follows from the AM-GM inequality.


We may also replace m by
√ √
m0 = min {( ak − ak+1 )2 }
1≤k≤n

in (2) to obtain, in a way, a sharper lower bound. A similar proof works. We leave it to the reader
as an exercise.
Even more generally, one can ask for a comparison between the difference between the arithmetic and
geometric means of a set of n nonnegative real numbers, and the maximum (or average) difference
between the arithmetic and geometric means over all k-element subsets. The authors do not know
what the correct inequalities should look like or how they may be proved.
12 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

11. Let n be a positive integer. Prove that

n µ ¶−1
X n+1
n n + 1 X 2i
= .
i 2n+1 i
i=0 i=1

Solution: Let
n µ ¶ n
1 X n −1 X k!(n − k)!
Sn = = .
n+1 k (n + 1)!
k=0 k=0
P
We must show that Sn = ( n+1 k
k=1 2 /k)/2
n+1 . To do so, it suffices to check that S = 1, which is
1
clear, and that 2n+2 Sn+1 − 2n+1 Sn = 2n+2 /(n + 2). Now
 
n+1 µ ¶ n+1 µ ¶
1 X n + 1 −1 X n + 1 −1 
2Sn+1 = +
n+2 i j
i=0 j=0

n
õ ¶ µ ¶ !
2 1 X n + 1 −1 n + 1 −1
= + +
n+2 n+2 i i+1
i=0
n
2 1 X i!(n + 1 − i)! + (i + 1)!(n − i)!
= +
n+2 n+2 (n + 1)!
i=0
n
2 1 X i!(n − i)!(n + 1 − i + i + 1)
= +
n+2 n+2 (n + 1)!
i=0

2
= Sn + ,
n+2

as claimed.

12. Express
n
X
(−1)k (n−k)!(n+k)!
k=0

in closed form.

Solution: (By Tiankai Liu) Let

f (k) = (n+1−k)!(n+k)!

for integers 0 ≤ k ≤ n + 1. Note that

f (k) + f (k + 1)
= (n+1−k)!(n+k)! + (n−k)!(n+k+1)!
= (n + 1 − k + n + k + 1)(n−k)!(n+k)!
= 2(n + 1)(n−k)!(n+k)!.
Mathematics Olympiad Coachs Seminar, Zhuhai, China 13

Therefore,
n
X
(−1)k (n−k)!(n+k)!
k=0
X n
1
= (−1)k [f (k) + f (k + 1)]
2(n + 1)
k=0
f (0) + (−1)n f (n + 1)
=
2(n + 1)
(n+1)!n! + (−1)n 0!(2n+1)!
=
2(n + 1)
(n!)2 (−1)n (2n+1)!
= + .
2 2(n + 1)

13. Prove that, for all positive real numbers a, b, c,

(a3 + b3 + abc)−1 + (b3 + c3 + abc)−1 + (c3 + a3 + abc)−1 ≤ (abc)−1 .

Solution: The inequality (a − b)(a2 − b2 ) ≥ 0 implies a3 + b3 ≥ ab(a + b), so


1 1 c
≤ = .
a3 3
+ b + abc ab(a + b) + abc abc(a + b + c)

Similarly
1 1 a
≤ = ,
b3 + c3 + abc bc(b + c) + abc abc(a + b + c)
and
1 1 b
≤ = .
c3 3
+ a + abc ca(c + a) + abc abc(a + b + c)
Thus
1 1 1 a+b+c 1
+ 3 + 3 ≤ = .
a3 3 3 3
+ b + abc b + c + abc c + a + abc abc(a + b + c) abc

14. Let a, b, c be positive real numbers such that

a + b + c ≥ abc.

Prove that at least two of the inequalities


2 3 6 2 3 6 2 3 6
+ + ≥ 6, + + ≥ 6, + + ≥6
a b c b c a c a b
are true.

Solution: (by David Shin) Perform the substitutions x = 1/a, y = 1/b, and z = 1/c. It suf-
fices to prove that at least two of the inequalities

2x + 3y + 6z ≤ 6, 2y + 3z + 6x ≤ 6, 2z + 3x + 6y ≤ 6
14 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

are true, where


x, y, z > 0 and xy + yz + zx ≥ 1.
Assume, for the sake of contradiction, that at least two of the given inequalities are false. Without
loss of generality, we may assume that 2x + 3y + 6z < 6 and 2y + 3z + 6x < 6. Then

144 > [(2x + 3y + 6z) + (2y + 3z + 6x)]2


= (8x + 5y + 9z)2
= 64x2 + 80xy + 25y 2 + 81z 2 + 90yz + 144zx
= 64x2 − 64xy + 16y 2 + 9y 2 − 54yz + 81z 2
+144(xy + yz + zx)
= (8x − 4y)2 + (3y − 9z)2 + 144 ≥ 144,

a contradiction. Thus, our assumptions is false and at least two of the desired inequalities must be
true. To obtain equalities, that is two of the numbers
2 3 6 2 3 6 2 3 6
+ + , + + , + +
a b c b c a c a b
are equal to 6, we must have 8x − 4y = 3y − 9z = 0, or a : b : c = (1/x) : (1/y) : (1/z) = 2 : 1 : 3.
Therefore the equalities hold if and only if (a, b, c) = (1, 3, 2), (3, 2, 1), (2, 1, 3).

15. Prove that


(a2 + 2)(b2 + 2)(c2 + 2) ≥ 9(ab + bc + ca)
for all positive real numbers a, b, and c.

16. Let a0 , a1 , · · · , an be numbers from the interval (0, π/2) such that
π π π
tan(a0 − ) + tan(a1 − ) + · · · + tan(an − ) ≥ n − 1.
4 4 4
Prove that
tan a0 tan a1 · · · tan an ≥ nn+1 .

Solution: Let bk = tan(ak − π/4), k = 0, 1, . . . , n. It follows from the hypothesis that for each k,
−1 < bk < 1, and X
1 + bk ≥ (1 − bl ). (1)
0≤l6=k≤n

Applying AM-GM to the positive numbers 1 − bl , l = 0, 1, . . . , k − 1, k + 1, . . . , n, we obtain


 1/n
X Y
(1 − bl ) ≥ n  (1 − bl ) . (2)
0≤l6=k≤n 0≤l6=k≤n

From (1) and (2) it follows that

n
à n
!1/n
Y Y
(1 + bk ) ≥ nn+1 (1 − bl )n ,
k=0 l=0
Mathematics Olympiad Coachs Seminar, Zhuhai, China 15

and hence that


n
Y 1 + bk
≥ nn+1 .
1 − bk
k=0

Because ³³
1 + bk 1 + tan(ak − π4 ) π´ π´
= = tan ak − + = tan ak ,
1 − bk 1 − tan(ak − π4 ) 4 4
the conclusion follows.

17. Let R be the set of real numbers. Determine all functions f : R → R such that

f (x2 − y 2 ) = xf (x) − yf (y)

for all pairs of real numbers x and y.

Solution: Setting x = y = 0 in the given condition yields f (0) = 0. Since

−xf (−x) − yf (y) = f ([−x]2 − y 2 ) = f (x2 − y 2 )


= xf (x) − yf (y),

we have f (−x) = −f (x) for x 6= 0. Hence f (x) is odd. From now on, we assume x, y ≥ 0.
Setting y = 0 in the given condition yields f (x2 ) = xf (x). Hence f (x2 − y 2 ) = f (x2 ) − f (y 2 ), or,
f (x2 ) = f (x2 − y 2 ) + f (y 2 ). Since for x ≥ 0 there is a unique t ≥ 0 such that t2 = x, it follows that

f (x) = f (x − y) + f (y) (1)

Setting x = 2t and y = t in (1) gives


f (2t) = 2f (t). (2)
Setting x = t + 1 and y = t in the given condition yields

f (2t + 1) = (t + 1)f (t + 1) − tf (t). (3)

By (2) and by setting x = 2t + 1 and y = 1 in (1), the left-hand side of (3) becomes

f (2t + 1) = f (2t) + f (1) = 2f (t) + f (1). (4)

On the other hand, by setting x = t + 1 and y = 1 in (1), the right-hand side of (3) reads

(t + 1)f (t + 1) − tf (t) = (t + 1)[f (t) + f (1)] − tf (t),

or,
(t + 1)f (t + 1) − tf (t) = f (t) + (t + 1)f (1). (5)
Putting (3), (4), and (5) together leads to 2f (t) + f (1) = f (t) + (t + 1)f (1), or,

f (t) = tf (1)

for t ≥ 0. Recall that f (x) is odd; we conclude that f (−t) = −f (t) = −tf (1) for t ≥ 0. Hence
f (x) = kx for all x, where k = f (1) is a constant. It is not difficult to see that all such functions
indeed satisfy the conditions of the problem.
16 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

18. Let a, b, and c be nonnegative real numbers such that

a2 + b2 + c2 + abc = 4.

Prove that
0 ≤ ab + bc + ca − abc ≤ 2.

First Solution: (By Richard Stong) From the condition, at least one of a, b, and c does not
exceed 1, say a ≤ 1. Then

ab + bc + ca − abc = a(b + c) + bc(1 − a) ≥ 0.

To obtain equality, we have a(b + c) = bc(1 − a) = 0. If a = 1, then b + c = 0 or b = c = 0, which


contradicts the given condition a2 + b2 + c2 + abc = 4. Hence 1 − a 6= 0 and only one of b and c is 0.
Without loss of generality, say b = 0. Therefore b + c > 0 and a = 0. Plugging a = b = 0 back into
the given condition gives c = 2. By permutation, the lower bound holds if and only if (a, b, c) is one
of the triples (2, 0, 0), (0, 2, 0), and (0, 0, 2).
Now we prove the upper bound. Let us note that at least two of the three numbers a, b, and c are
both greater than or equal to 1 or less than or equal to 1. Without loss of generality, we assume that
the numbers with this property are b and c. Then we have

(1 − b)(1 − c) ≥ 0. (1)

The given equality a2 + b2 + c2 + abc = 4 and the inequality b2 + c2 ≥ 2bc imply

a2 + 2bc + abc ≤ 4, or bc(2 + a) ≤ 4 − a2 .

Dividing both sides of the last inequality by 2 + a yields

bc ≤ 2 − a. (2)

Combining (1) and (2) gives

ab + bc + ac − abc ≤ ab + 2 − a + ac(1 − b)
= 2 − a(1 + bc − b − c)
= 2 − a(1 − b)(1 − c) ≤ 2,

as desired.
The last equality holds if and only if b = c and a(1−b)(1−c) √ = 0.√Hence,
√ equality
√ for the√upper
√ bound
holds if and only if (a, b, c) is one of the triples (1, 1, 1), (0, 2, 2), ( 2, 0, 2), and ( 2, 2, 0).

Second Solution: (by Oaz Nir) We prove only the upper bound here. Either two of a, b, c
are less than or equal to 1, or two are greater than or equal to 1. Assume b and c have this property.
Then
b + c − bc = 1 − (1 − b)(1 − c) ≤ 1. (3)
Viewing the given equality as a quadratic equation in a and solving for a yields
p
−bc ± (b2 − 4)(c2 − 4)
a= .
2
Mathematics Olympiad Coachs Seminar, Zhuhai, China 17

Note that

(b2 − 4)(c2 − 4) = b2 c2 − 4(b2 + c2 ) + 16


≤ b2 c2 − 8bc + 16 = (4 − bc)2 .

For the given equality to hold, we must have b, c ≤ 2 so that 4 − bc ≥ 0. Hence,


−bc + |4 − bc| −bc + 4 − bc
a≤ = = 2 − bc,
2 2
or
2 − bc ≥ a. (4)
Combining (3) and (4) gives

2 − bc ≥ a(b + c − bc) = ab + ac − abc,

or
ab + ac + bc − abc ≤ 2,
as desired.

Third Solution: We prove only the upper bound here. Define functions f , g as

f (x, y, z) = x2 + y 2 + z 2 + xyz = (x + y)2 + z 2 − (2 − z)xy,


g(x, y, z) = xy + yz + zx − xyz = z(x + y) + (1 − z)xy

for all nonnegative numbers x, y, z. Observe that if z ≤ 1, then both f and g are unbounded,
increasing functions of x and y.
Assume that f (a, b, c) = 4 and, without loss of generality, that a ≥ b ≥ c ≥ 0. Then c ≤ 1.
¡ ¢2
Let a0 = (a + b)/2. Because a + b = a0 + a0 and ab ≤ a−b 2 + ab = a0 2 , we have

f (a0 , a0 , c) ≤ f (a, b, c) = 4 and g(a0 , a0 , c) ≥ g(a, b, c).

Now increase a0 to e ≥ 0 such that f (e, e, c) = 4. Note that g(e, e, c) ≥ g(a0 , a0 , c). It suffices to prove
that g(e, e, c) ≤ 2.
Since f (e, e, c) = 2e2 + c2 + e2 c = 4, e2 = (4 − c2 )/(2 + c) = 2 − c. We obtain that

g(e, e, c) = 2ec + (1 − c)e2 ≤ e2 + c2 + (1 − c)e2


= (2 − c)e2 + c2 = (2 − c)2 + c2
= 2(2 − 2c + c2 ) = 2[1 + (1 − c)2 ] ≤ 2,

as desired.

19. Let a, b, and c be positive real numbers, not all equal. Find all solutions to the system of equations

x2 − yz = a,
y 2 − zx = b,
z 2 − xy = c,

in real numbers x, y, and z.


18 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Solution: Squaring each equation and subtracting the product of the other two yields

a2 − bc = x(x3 + y 3 + z 3 − 3xyz),
b2 − ca = y(x3 + y 3 + z 3 − 3xyz),
c2 − ab = z(x3 + y 3 + z 3 − 3xyz).

Let k = x3 + y 3 + z 3 − 3xyz. Then

(a2 − bc)2 − (b2 − ca)(c2 − ab) = k 2 (x2 − yz) = k 2 a.

The same computation that produced the system above shows tha the expression on the left is
a(a3 + b3 + c3 − 3abc), and the latter is positive by the AM-GM inequality. Hence
p
k = ± a3 + b3 + c3 − 3abc

and the solutions to the system (one for each choice of k) are
a2 − bc b2 − ca c2 − ab
x= , y= , and z = .
k k k
20. Find all functions f : N → N satisfying

f (f (f (n))) + 6f (n) = 3f (f (n)) + 4n + 2001,

for all n ∈ N.

Solution: We first look for a function of the form f (n) = n + a. The relation from the state-
ment yields a = 667, and hence f (n) = n + 667 is a solution. Let us show that this is the only
solution.
Fix some positive integer n and define a0 = n, and ak = f (ak−1 0 for k ≥ 1. The sequence {ak }k≥0
satisfies the recursive relation

ak+3 − 3ak+2 + 6ak+1 − 4ak = 2001 (1)

A particular solution is ak = 667k. The characteristic equation of the homogeneous recurrence


ak+3 − 3ak+2 + 6ak+1 − 4ak = 0 is

x3 − 3x2 + 6x − 4 = 0.

It is not hard to guess that x1 = 1 is a solution to this equation. Since x3 − 3x2 + 6x + 4 =


(x − 1)(x2 − 2x + 4), the other two zeros are x2 = 2 cis 120◦ and x3 = 2 cis (−120◦ ). It follows that
the general solution to (1) is of the form

ak = c1 + 2k c2 cos(120◦ n) + 2k c3 sin(120◦ n) + 667k

with c1 , c2 , c3 some real constants.


if c2 > 0, then a3(2m+1) will be negative for large m and if c2 < 0, then a6m will be negative for large
m. Since f can only take positive values, this implies that c2 = 0. A similar argument shows that
c3 = 0. It follows that ak = c1 + 667k. So the first term of the sequence determine all the others.
Since a0 = n, c1 = n, and hence ak = n + 667k, for all k. In particular a1 = f (n) = n + 667, and
hence this is the only possible solution.
Mathematics Olympiad Coachs Seminar, Zhuhai, China 19

21. Let a1 , . . . , an and b1 , . . . , bn be two sequences of distinct numbers such that ai + bj 6= 0 for all i, j.
Show that if ½
Xn
cj,k 1 if i = k
=
ai + bj 0 otherwise,
j=1

then the sum of all n2 numbers cjk is (a1 + · · · + an ) + (b1 + · · · + bn ).

Pn
Solution: Let rj = k=1 cj,k . Then
n
X n Pn
X n X
X n n X
X n
rj k=1 cj,k cj,k cj,k
= = = = 1, (1)
ai + bj ai + bj ai + bj ai + bj
j=1 j=1 j=1 k=1 k=1 j=1

for all i = 1, 2, . . . , n. We wish to determine r1 + r2 + · · · + rn . Let


n
X rj
R(x) = . (2)
x + bj
j=1

Then R(x) = P (x)/Q(x) where Q(x) = (x + b1 )(x + b2 ) · · · (x + bn ) and P (x) has degree at most
n − 1. By (1), R(a1 ) = R(a2 ) = · · · = R(an ) = 1, so if we write

S(x)
R(x) = 1 − ,
Q(x)

then S(x) is a monic polynomial of degree n and S(a1 ) = S(a2 ) = · · · = S(an ) = 0. Hence

S(x) = (x − a1 )(x − a2 ) · · · (x − an ).

Consider the coefficient of xn−1 in P (x) = Q(x) − S(x). Form (2), this coefficient is r1 + r2 + · · · + rn .
On the other hand,

Q(x) = (x + b1 )(x + b2 ) · · · (x + bn ) and S(x) = (x − a1 )(x − a2 ) · · · (x − an ).

Applying the Vieta’s theorem, this coefficient is (a1 + a2 + · · · + an ) + (b1 + b2 + · · · + bn ). Hence


we have our desired result.

22. Suppose the positive integers have been expressed as a disjoint union of arithmetic progressions
{ai + ndi }∞
n=0 , i = 1, 2, . . . , k. Show that

k
X ai k+1
= .
di 2
i=1

Solution: Note that


k
X xai x
d
= ,
1−x i 1−x
i=1
or
k
X xai −1 1
d
= , (1)
1−x i 1−x
i=1
20 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

as each power of x appears with coefficient 1 on both sides of the equations. Multiplying both sides
of (1) by (1 − x) yields
X k
xai −1
= 1.
1 + x + · · · + xdi −1
i=1
Setting x = 1 in the last equation gives
k
X 1
= 1.
di
i=1
We now rewriting (1) as
k µ ai −1
X ¶ k
X 1
x −1 1 di
+ = ,
1 − xdi 1 − xdi 1−x
i=1 i=1
that is, Ã !
k
X 1 k
X
1 di 1 + x + · · · + xai −2
− = .
1 − xdi 1−x 1 + x + · · · + xdi −1
i=1 i=1
Hence
k
X k
X
di − 1 − x − · · · − xdi −1 1 + x + · · · + xai −2
= ,
di (1 − xdi ) 1 + x + · · · + xdi −1
i=1 i=1
or
k
X k
X
(1 − x)[(di − 1) + (di − 2)x + · · · + xdi −1 ] 1 + x + · · · + xai −2
= ,
di (1 − x)(1 + x + · · · + xdi −1 ) 1 + x + · · · + xdi −1
i=1 i=1
Setting x = 1 in the last equation yields
k
X k
X
(di − 1) + (di − 2) + · · · + 1 ai − 1
= ,
i=1
d2i i=1
di
or
k
X k
X k
X
di (di − 1) ai 1
= − .
i=1
2d2i i=1
di di
i=1
Hence
k
X k µ
X ¶
ai 1 1 k+1
= + = ,
di 2 2di 2
i=1 i=1
as desired.
23. Let b
P S be the set of perfect powers, that is, the numbers of the form a for some a, b > 1. Show that
n∈S 1/(n − 1) = 1.

Solution: Note that


∞ µ
∞ X ¶ X∞
à ! ∞
X 1 1 1 X 1
= · 1 = = 1.
ab 2
a 1− a
a(a − 1)
a=2 b=2 a=2 a=2

On the other hand, the desired sum


X ∞
XX
1 1
= .
n−1 nm
n∈S n∈S m=1
Mathematics Olympiad Coachs Seminar, Zhuhai, China 21

But this is just the same as my first sum. Indeed, for any denominator d, the number of times 1/d
occurs in the first sum is the number of representations d = ab (a, b ≥ 2), while the number of times
1/d occurs in the second sum is the number of representations d = nm (n ∈ S, m ≥ 1). If we write
d = pq with p minimal, then both these multiplicities are equal to f (q) − 1, where f (q) denote the
number of divisors of q. So the sums really are the same.

24. Prove that the product of any k consecutive Fibonacci numbers is divisible by the product of the
first k Fibonacci numbers.

Solution: Let [k]! = F1 F2 · · · Fk for k ≥ 1 and [0]! = 1, and let Ra,b = [a + n]!/([a]![b]!)
√ for
a, b ≥ 0. √We need to show that Ra,b is an integer for all a, b ≥ 0. Putting α = (1 + 5)/2 and
β = (1 − 5)/2, we have

αn − β n
Fn = = αn−1 + αn−2 β + · · · + β n−1 (1)
α−β

for all n ≥ 1. From this one can derive the recursice relation

Ra,b = αa Ra,b−1 + β b Rx−1,b (2)

for a, b ≥ 1, since dividing both sides of (2) by [a + b − 1]!/([a]![b]!) converts it into the formula

Fa+b = αa Fb + β b Fa

which in turn follows easily from (1). The recursive relation (2), combined with the initial conditions
Ra,0 = R0,b = 1 for all a, b ≥ 0, guarantees that Ra,b is always expressible as a polynomial in α and
β with integer coefficients.
Now since β = 1 − α, Ra,b can be expressed as a polynomial in α with integer coefficients. Conse-
quently, iteratively applying αn = αn−1 + αn−2 for n ≥ 2, we can write Ra,b in the form r + sα, where
r and s are integers. Note that Ra,b is rational and α is irrational. Hence s = 0 and Ra,b = r is an
integer.

25. Prove that any monic polynomial (a polynomial with leading coefficient 1) of degree n with real
coefficients is the average of two monic polynomials of degree n with n real roots.

First Solution: (Tiankai Liu) Let us begin with the following lemma.
Lemma. For any set of n ordered pairs of real numbers {(xi , yi )}ni=1 , with xi 6= xj for all i 6= j,
there exists a unique monic real polynomial P (x) of degree n such that P (xi ) = yi for all integers
i ∈ [1, n].
We present two proofs of the lemma.

• First proof By the Lagrange Interpolation Formula, there exists a unique real polynomial
Q(x) of degree less than n such that Q(xi ) = yi − xni for all integers i = 1, 2, . . . , n. Then we
can, and must, have P (x) = Q(x) + xn .
• Second proof By the Lagrange Interpolation Formula, there exists a unique real polynomial
Q(x) of degree less than n suchQthat Q(xi ) = yi for all integers i = 1, 2, . . . , n. Then we can,
and must, have P (x) = Q(x) + ni=1 (x − xi ).
22 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Let the given monic real polynomial be F (x). Choose any strictly decreasing sequence of n real
numbers x1 , . . . , xn . For each odd i, choose a yi such that yi < min{0, 2F (xi )}. For each even i,
choose a yi such that yi > max{0, 2F (xi )}.
Let P (x) be the monic real polynomial of degree n such that P (xi ) = yi for all integers i = 1, 2, . . . , n;
the existence of such a P (x) is guaranteed by the lemma. Let Q(x) = 2F (x) − P (x).
Note that, for each integer i = 1, 2, . . . , n − 1, P (x) has a root in (xi+1 , xi ) because P (xi+1 ) and
P (xi ) have opposite signs and polynomial functions are continuous. Similarly, for each integer i =
1, 2, . . . , n − 1, Q(X) has a root in (xi+1 , xi ) because 2F (xi+1 ) − P (xi+1 ) and 2F (xi ) − P (xi ) have
opposite signs.
Therefore, we are guaranteed that P (x) and Q(x) each have n roots with at least n − 1 of them are
real. Because imaginary roots of real polynomials come in conjugate pairs, all real polynomials have
an even number of imaginary roots. Hence the other root of P (x) must also be real, and the same
holds for Q(x). Thus, P (x) and Q(x) each have n real roots.

Note: One could also prove that P (x) and Q(x) both have n real roots by the following argu-
ment. Because P (x) has a positive leading coefficient, limx→∞ P (x) = ∞. Because P (x1 ) < 0, then,
P (x) has another root in (x1 , +∞). Similarly, Q(x) also has a leading coefficient of +1. If n is odd,
then limx→−∞ Q(x) = −∞, so because Q(xn ) > 0, Q(x) has another root in (−∞, xn ). If n is even,
then limx→−∞ Q(x) = ∞, so because Q(xn ) < 0, Q(x) has another root in (−∞, xn ).

Second Solution: Let F (x) be the monic real polynomial of degree n. If n = 1, then F (x) = x + a
for some real number a. Then F (x) is the average of x + 2a and x, each of which has 1 real root.
Now we assume that n > 1. Define the polynomial
G(x) = (x − 2)(x − 4) · · · (x − 2(n − 1)).
The degree of G(x) is n − 1. Consider the polynomials
P (x) = xn − kG(x)
and
Q(x) = 2F (x) − P (x) = 2F (x) − xn + kG(x).
We will show that for large enough k these two polynomials have n real roots. Since they are monic
and their average is F (x), this will solve the problem.
Consider the values of polynomial G(x) at n points x = 1, 3, 5, . . . , 2n − 1. These values alternate
in sign and have magnitude at least 1 (because at most two of the factors have magnitude 1 and
the others have magnitude at least 2). On the other hand, there is a constant c > 0 such that for
0 ≤ x ≤ 2n − 1, we have |xn | < c and |2F (x) − xn | < c. Take k > c. Then we see that P (x) and Q(x)
evaluated at n points x = 1, 3, 5, . . . , 2n − 1 alternate in sign. Thus, polynomials P (x) and Q(x) each
have at least n − 1 real roots — one in each interval (1, 3), . . ., (2n − 3, 2n − 1). However, since they
are polynomials of degree n, they must then each have n real roots (as in the previous solution), as
desired.
26. Prove that for any integer n, there exists a unique polynomial Q with coefficients in {0, 1, . . . , 9} such
that Q(−2) = Q(−5) = n.

Solution: First suppose there exists a polynomial Q with coefficients in {0, 1, . . . , 9} such that
Q(−2) = Q(−5) = n. We shall prove that this polynomial is unique. By the Factor Theorem, we can
Mathematics Olympiad Coachs Seminar, Zhuhai, China 23

write Q(x) = P (x)R(x)+n where P (x) = (x+2)(x+5) = x2 +7x+10 and R(x) = r0 +r1 x+r2 x2 +· · ·
is a polynomial. Then r0 , r1 , r2 , . . . are integers such that

10r0 + n, 10rk + 7rk−1 + rk−2 ∈ {0, 1, . . . , 9}, k≥1 (∗)

(with the understanding that r−1 = 0). For each k, (∗) uniquely determines rk once rj is known for
all j < k. Uniqueness of R, and therefore of Q, follows.
Existence will follow from the fact that for the unique sequence {rk } satisfying (∗), there exists some
N such that rk = 0 for all k ≥ N . First note that {rk } is bounded, since |r0 |, |r1 | ≤ B and B ≥ 9
imply |rk | ≤ B for all k. This follows by induction, using 10|rk | ≤ 7|rk−1 | + |rk−2 | + 9 ≤ 10B. More
specifically, if ri ≤ M for i = k − 1, k − 2, then
7rk−1 rk−2 4M
rk ≥ − − ≥− ,
10 10 5
while if ri ≥ L for i = k − 1, k − 2, then
7rk−1 rk−2 9 4L 9
rk ≤ − − + ≤− + .
10 10 10 10 10
Since the sequence {rk } is bounded, we can define

Lk = min{rk , rk−1 , . . . }, Mk = max{rk , rk+1 , . . . }.

Clearly Lk ≤ Lk+1 and Mk ≥ Mk+1 for all k.


Since Lk ≤ Mk for all k, the non-decreasing sequence {Lk } must stop increasing eventually, and, sim-
ilarly, the non-increasing sequence {Mk } must stop decreasing. In other words, there exist L, M, N
such that Lk = L and Mk = M for all k ≥ N . Certainly L ≤ M , and M ≥ 0, since no three
consecutive terms in {rk } can be negative, but the above arguments also imply L ≥ −4M/5 and
M ≤ −4L/5+9/10. A quick sketch shows that the set of real pairs (L, M ) satisfying these conditions
is a closed triangular region containing no lattice points other than (0, 0). It follows that rk = 0 for
all k ≥ N , proving existence.

27. Let a1 , b1 , a2 , b2 , . . . , an , bn be nonnegative real numbers. Prove that


n
X n
X
min{ai aj , bi bj } ≤ min{ai bj , aj bi }.
i,j=1 i,j=1

Solution: (Based on work by George Lee) Define


X
L(a1 , b1 , . . . , an , bn ) = (min{ai bj , aj bi } − min{ai aj , bi bj }).
i,j

Our goal is to show that


L(a1 , b1 , . . . , an , bn ) ≥ 0
for a1 , b1 , . . . , an , bn ≥ 0. Our proof is by induction on n, the case n = 1 being evident. Using the
obvious identities

• L(a1 , 0, a2 , b2 , . . . ) = L(0, b1 , a2 , b2 , . . . ) = L(a2 , b2 , . . . ),


• L(x, x, a2 , b2 , . . . ) = L(a2 , b2 , . . . ),
24 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

and the less obvious but easily verified identities

• L(a1 , b1 , a2 , b2 , a3 , b3 , . . . ) = L(a1 + a2 , b1 + b2 , a3 , b3 , . . . ) if a1 /b1 = a2 /b2 ,


• L(a1 , b1 , a2 , b2 , a3 , b3 , . . . ) = L(a2 − b1 , b2 − a1 , a3 , b3 , . . . ) if a1 /b1 = b2 /a2 and a1 ≤ b2 ,

we may deduce the result from the induction hypothesis unless we are in the following situation:

(a) all of the ai and bi are nonzero;


(b) for i = 1, . . . , n, ai 6= bi ;
(c) for i 6= j, ai /bi 6= aj /bj and ai /bi 6= bj /aj .

For i = 1, . . . , n, let ri = max{ai /bi , bi /ai }. Without loss of generality, we may assume 1 < r1 <
· · · < rn , and that a1 < b1 . Now notice that f (x) = L(a1 , x, a2 , b2 , . . . , an , bn ) is a linear function of
x in the interval [a1 , r2 a1 ]. Explicitly,

f (x) = min{a1 x, xa1 } − min{a21 , x2 } + L(a2 , b2 , . . . , an , bn )


Xn
+2 (min{a1 bj , xaj } − min{a1 aj , xbj })
j=2
n
X
= (x − a1 )(a1 + 2 cj ) + L(a2 , b2 , . . . , an , bn ),
j=2

where cj = −bj if aj > bj and cj = aj if aj < bj .


In particular, since f is linear, we have

f (x) ≥ min{f (a1 ), f (r2 a1 )}.

Note that f (a1 ) = L(a1 , a1 , a2 , b2 , . . . ) = L(a2 , b2 , . . . ) and

f (r2 a1 ) = L(a1 , r2 a1 , a2 , b2 , . . . )
½
L(a1 + a2 , r2 a1 + b2 , a3 , b3 , . . . ) if r2 = b2 /a2 ,
=
L(a2 − r2 a1 , b2 − a1 , a3 , b3 , . . . ) if r2 = a2 /b2 .

Thus we deduce the desired inequality from the induction hypothesis in all cases.

Note: More precisely, it can be shown that for ai , bi > 0, equality holds if and only if, for each
r > 1, the set Sr of indices i in {1, . . . , n} such that ai /bi ∈ {r, 1/r} has the property that
X X
ai = bi .
i∈Sr i∈Sr

Namely, assume this is the case for n − 1 pairs. Given n pairs, if conditions (a)-(c) are not all met, we
may deduce the result from the induction hypothesis by the same reductions as that at the beginning
of the proof. If (a)-(c) are met, then for equality to hold, 0 = f (b1 ) ≥ min{f (a1 ), f (r2 a1 )} ≥ 0.
Since f (x) is linear on the interval [a1 , r2 a1 ], f (x) is identically zero on the interval. Since f (a1 ) = 0,
L(a2 , b2 , . . . ) = 0. Applying the induction hypothesis, with all of ai and bi nonzero ((a) is met) and
ri > 1 ((b) is met), we have

(i) for each i ≥ 2, there exists an r > 1 such that either ai = rbi or bi = rai .
Mathematics Olympiad Coachs Seminar, Zhuhai, China 25

n
X
(ii) (aj − bj ) = 0.
j=2

Therefore, if aj > bj , aj = rbj and cjP (1 − r) = (−bj )(1 − r) = aj − bj ; if aj < bj , raj = bj and
cj (1 − r) = aj (1 − r) = aj − bj . Hence nj=2 cj = 0. But then 0 = f (r2 a1 ) yields
n
X
0 = (r2 a1 − a1 )(a1 + 2 cj ) + L(a2 , b2 , . . . , an , bn ) = (r2 − 1)a21
j=2

and a1 = 0, a contradiction.
Mathematics Olympiad Coachs Seminar, Zhuhai, China 1

03/23/2004

Number Theory
1. Prove that for every positive integer n there exists an n-digit number divisible by 5n all of whose
digits are odd.

2. Determine all finite nonempty sets S of positive integers satisfying


i+j
is an element of S for all i, j in S,
gcd(i, j)
where gcd(i, j) is the greatest common divisor of i and j.

3. Suppose that the set {1, 2, · · · , 1998} has been partitioned into disjoint pairs {ai , bi } (1 ≤ i ≤ 999)
so that for all i, |ai − bi | equals 1 or 6. Prove that the sum

|a1 − b1 | + |a2 − b2 | + · · · + |a999 − b999 |

ends in the digit 9.

Solution: Let k denote the number of pairs {ai , bi } with |ai − bi | = 6. Then the sum in question
is k · 6 + (999 − k) · 1 = 999 + 5k, which ends in 9 provided k is even. Hence it suffices to show that
k is even.
Write k = kodd +keven , where kodd (resp. keven ) is equal to the number of pairs {ai , bi } with ai , bi both
odd (resp. even). Since there are as many even numbers as odd numbers between 1 and 1998, and
since each pair {ai , bi } with |ai −bi | = 1 contains one number of each type, we must have kodd = keven .
Hence k = kodd + keven is even as claimed.

4. For a real number x, let bxc denote the largest integer that is less than or equal to x. Prove that
¹ º
(n − 1)!
n(n + 1)
is even for every positive integer n.

5. Let p1 , p2 , p3 , . . . be the prime numbers listed in increasing order, and let x0 be a real number between
0 and 1. For positive integer k, define
½ ¾
pk
xk = 0 if xk−1 = 0, if xk−1 6= 0,
xk−1
where {x} = x − bxc denotes the fractional part of x. Find, with proof, all x0 satisfying 0 < x0 < 1
for which the sequence x0 , x1 , x2 , . . . eventually becomes 0.

Solution: The sequence eventually becomes 0 if and only if x0 is a rational number.


First we prove that, for k ≥ 1, every rational term xk has a rational predecessor xk−1 . Suppose xk is
rational. If xk = 0 then either xk−1 = 0 or pk /xk−1 is a positive integer; either way, xk−1 is rational.
If xk is rational and nonzero, then the relation
½ ¾ ¹ º
pk pk pk
xk = = −
xk−1 xk−1 xk−1
2 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

yields
p
xk−1 = ¹k º,
pk
xk +
xk−1
which shows that xk−1 is rational. Since every rational term xk with k ≥ 1 has a rational predecessor,
it follows by induction that, if xk is rational for some k, then x0 is rational. In particular, if the
sequence eventually becomes 0, then x0 is rational.
To prove the converse, observe that if xk−1 = m/n with 0 < m < n, then xk = r/m, where r is
the remainder that results from dividing npk by m. Hence the denominator of each nonzero term is
strictly less than the denominator of the term before. In particular, the number of nonzero terms in
the sequence cannot exceed the denominator of x0 .
Note that the above argument applies to any sequence {pk } of positive integers, not just the sequence
of primes.

6. A square can be cut into n congruent squares, and a square can be cut into n + m congruent squares.
Determine all m such that the values of n is unique.

7. Prove that for each n ≥ 2, there is a set S of n integers such that (a − b)2 divides ab for every distinct
a, b ∈ S.

Solution: We will prove by induction on n, that we can find such a set Sn , all of whose ele-
ments are nonnegative. For n = 2, we may take S2 = {0, 1}.
Now suppose that for some n ≥ 2, the desired set Sn of n nonnegative integers exists. Let L be the
least common multiple of those numbers (a − b)2 and ab that are nonzero, with (a, b) ranging over
pairs of distinct elements from Sn . Define

Sn+1 = {L + a : a ∈ Sn } ∪ {0}.

Then Sn+1 consists of n + 1 nonnegative integers, since L > 0. If α, β ∈ Sn+1 and either α of β is
zero, then (α − β)2 divides αβ. If L + a, L + b ∈ Sn+1 , with a, b distinct elements of Sn , then

(L + a)(L + b) ≡ ab ≡ 0 (mod(a − b)2 ),

so [(L + a) − (L + b)]2 divides (L + a)(L + b), completing the inductive step.

8. Let M be the number of integer solutions of the equations

x2 − y 2 = z 3 − t3

with the property 0 ≤ x, y, z, t ≤ 106 , and let N be the number of integer solutions of the equation

x2 − y 2 = z 3 − t3 + 1

that have the same property. Prove that M > N .

Solution: Write down two equations in the form

x2 + t3 = y 2 + z 3 and x2 + t3 = y 2 + z 3 + 1
Mathematics Olympiad Coachs Seminar, Zhuhai, China 3

and, for each k = 0, 1, 2, . . . , denote y nk the number of integer solutions of the equations u2 + v 3 = k
with the property 0 ≤ u, v ≤ 106 . Clearly nk = 0 for all k greater than ` = (106 )2 + (106 )3 . Note
that
M = n20 + n21 + · · · + n2` and N = n0 n1 + n1 n2 + · · · + n`−1 n` . (1)

To prove, for example, the second of these equalities, note that to any integer solution of x2 + y 3 =
y 2 + z 3 + 1 with ) ≤ x, y, z, t ≤ 106 there corresponds a k (1 ≤ k ≤ `) such that

x2 + t3 = k and y 2 + z 3 = k − 1. (2)

And for any such k, the pairs (x, t) and (y, z) satisfying (2) can be chosen independently of one
another in nk and nk−1 ways, respectively. Hence for each k = 1, 2, . . . , ` there are nk−1 nk solutions
of x2 + t3 = y 2 + z 3 + 1 with x2 + y 3 = y 2 + z 3 + 1 = k, which implies the second equality in (1).
The proof of the first is essentially the same.
It is not hard to deduce from (1) that M > N. Indeed, a little algebra work shows that

n20 + (n0 − n1 )2 + (n1 − n2 )2 + · · · + (n`−1 − n` )2 + n2`


M −N = > 0,
2

since n0 = 1 > 0.

9. Let p be a prime number greater than 5. For any integer x, define

p−1
X 1
fp (x) = .
(px + k)2
k=1

Prove that for all positive integers x and y, the numerator of fp (x) − fp (y), when written in lowest
terms, is divisible by p3 .

Solution: We use the notation r ≡ s (mod n), for r and s rational numbers, to mean that
the numerator of r − s, when written in lowest terms, is divisible by n. This relation is symmetric
and transitive, just like congruence for integers.
It suffices to check that fp (x) ≡ fp (x + 1) (mod p3 ), or in other words,

p−1 µ
X ¶ p−1
X
1 1 (xp + i + p)2 − (xp + i)2
0 ≡ 2
− =
(xp + i) (xp + p + i)2 (xp + i)2 (xp + p + i)2
i=1 i=1
p−1
X p(2xp + 2i + p)
= (mod p3 ).
(xp + i)2 (xp + p + i)2
i=1

Of course, it suffices to show that after dividing both sides by p, the results are congruent modulo p2 .
For integer y and z, (y + zp)2 ≡ y(y + 2zp) (mod p2 ), so (y + zp)2 (y − 2zp) ≡ y(y + 2zp)(y − 2zp) ≡ y 3
(mod p2 ). Further suppose that y is not divisible by p. It follows that

1 y − 2zp
2
≡ (mod p2 ). (∗)
(y + zp) y3
4 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

(For a motivation of congruence (∗) please read the note at the end of the proof.) Thus
p−1
X 2i + p(2x + 1)
(xp + i)2 (xp + p + i)2
i=1
p−1
X 2i + p(2x + 1)
≡ (i − 2xp)[i − 2p(x + 1)]
i6
i=1
p−1
X 2i + p(2x + 1) 2
= [i − 2p(2x + 1)i + 4p2 x(x + 1)]
i6
i=1
p−1
X 2i + p(2x + 1)
≡ [i − 2p(2x + 1)]
i5
i=1
p−1
X 2i2 + pi(2x + 1) − 4pi(2x + 1) − 2p2 (2x + 1)2
=
i5
i=1
p−1
X X 1 p−1
2
≡ + 3p(2x + 1) (mod p2 ).
i3 i4
i=1 i=1

The rest of our proof is based on the following lemma.


Pp−1
Lemma. If n is an integer not divisible by p − 1, then i=1 in ≡ 0 (mod p).
Proof: Let g be a primitive root of p, that is, g is an integer relatively prime to p such that

{g, g 2 , . . . , g p−1 } ≡ {1, 2, . . . , p − 1} (mod p).

Because g is relatively prime to p,

{g · 1, g · 2, . . . , g · (p − 1)} ≡ {1, 2, 3, . . . , p − 1} (mod p).

Consequently,
p−1
X p−1
X p−1
X
in ≡ (ig)n = g n in
i=1 i=1 i=1
Pp−1
Because gn 6≡ 1 (mod p), we must have i=1 in ≡ 0 (mod p), as desired.
For p ≥ 7, we may apply this with n = −4. Combining this with the previous congruence, we get
p−1
X X 2 p−1
2i + p(2x + 1)
2 2
≡ (mod p2 ).
(xp + i) (xp + p + i) i3
i=1 i=1

Now note that


p−1
X p−1 µ
X ¶ p−1
X
2 1 1 p(p2 − 3pi + 3i2 )
≡ + ≡
i3 i 3 (p − i)3 i3 (p − i)3
i=1 i=1 i=1
p−1
X p−1
X 3p
3i2 p
≡ ≡ − 4 ≡ 0 (mod p2 ),
i3 (p − i)3 i
i=1 i=1

by the lemma. This proves the desired result.


Mathematics Olympiad Coachs Seminar, Zhuhai, China 5

Note: The congruence (∗) is suggested by formally expanding 1( y + zp)2 as an infinite series:

1
= y 2 (1 + p(z/y))−2 = y 2 (1 − 2p(z/y) + 3p2 (z/y)2 + · · · ).
(y + zp)2

This expansion of course does not converge in the real numbers; however, it does converge in a
different number system known as the p-adic numbers.

10. Let n be a positive integer, and let σ(n) denote the sum of the positive divisors of n, including 1 and
n itself. Prove that
σ(1) σ(2) σ(n)
+ + ··· + ≤ 2n.
1 2 n
11. Let a, b be integers greater than 2. Prove that there exists a positive integer k and a finite sequence
n1 , n2 , . . . , nk of positive integers such that n1 = a, nk = b, and ni ni+1 is divisible by ni + ni+1 for
each i (1 ≤ i < k).

Comment: We may say two positive integers a and b are connected, denoted by a ↔ b, if there
exists a positive integer k and a finite sequence n1 , n2 , . . . , nk of positive integers such that n1 = a,
nk = b, and ni ni+1 is divisible by ni + ni+1 for each i (1 ≤ i < k). The problem asks to prove that
a ↔ b for all a, b > 2.
It is not difficult to check that ↔ is an equivalence relation: it is reflexive (a ↔ a), symmetric (a ↔ b
implies b ↔ a). and transitive (a ↔ b, b ↔ c imply a ↔ c). We state this here so that it may be
used without further comment in all solutions.

First Solution: (by William Deringer) The condition (ni + ni+1 )kni ni+1 holds whenever ni+1 =
ni (d − 1), where d is any divisor of ni greater than 1. Indeed,

ni + ni+1 = ni dkn2i kn2i (d − 1) = ni ni+1 .

Therefore, if d is any divisor of n, then n ↔ n(d − 1)k for any nonnegative integer k, and n ↔
Qd−1
n(d − 1) ↔ n(d − 1)(d − 2) ↔ · · · ↔ n i=c i for any natural number c < d.
Whenever a > b > 2, there exists a natural number ` such that (b − 1)` > a. Let

(b−1)`
Y
X= i.
i=b

Then
a−1 a a a (b−1)` −1
Y Y Y Y Y
` `
a↔a i= i ↔ (b − 1) i ↔ (b − 1) i i = X,
i=b i=b i=b i=b i=a+1

and
(b−1)` −1
Y
` `
b ↔ b(b − 1) ↔ b(b − 1) i = X.
i=b+1

Therefore, a ↔ X and b ↔ X, so a ↔ b, as desired.


6 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Second Solution: Note that for any positive integer n with n ≥ 3, n ↔ 2n, as the sequence

n ↔ n(n − 1) ↔ n(n − 1)(n − 2) ↔ n(n − 2) ↔ 2n

satisfies the conditions of the problem. For any positive integer n ≥ 4, n0 = (n − 1)(n − 2) ≥ 3,
hence n0 ↔ 2n0 by the above argument. It follows that n ↔ n − 1 for n ≥ 4 by n0 ↔ 2n0 and by the
sequences

n ↔ n(n − 1) ↔ n(n − 1)(n − 2)


↔ n(n − 1)(n − 2)(n − 3) ↔ 2(n − 1)(n − 2)
↔ (n − 1)(n − 2) ↔ n − 1.

Iterating this, we connect all integers larger than 2.

Third Solution: Note that ni + ni+1 kni ni+1 if and only if

(ni + ni+1 )k[(ni + ni+1 )ni − ni ni+1 ] = n2i .

This means that ni+1 can be d − ni where d is any divisor of n2i , as long as that is positive. We
repeatedly use this to obtain the following facts.

• Fact 1 By successively taking ni = 4a, 4a(a − 1), 4a(a + 1), we have

4a ↔ 4a2 − 4a = 4a(a − 1) ↔ 8a2 − 4a(a − 1) = 4a(a + 1) ↔ 4(a + 1)2 − 4a(a + 1) = 4(a + 1)

for integers a ≥ 2.
• Fact 2 4 ↔ 42 − 4 = 12.
• Fact 3 2a ↔ 2a2 − 2a = 2a(a − 1) for all a ≥ 2.
• Fact 4 a ↔ a2 − a = a(a − 1) for all a ≥ 2.

We also note that a(a − 1) is even for all integers a.


The first two facts together prove that all positive multiples of 4 are connected. The third fact proves
that each even number ≥ 4 is connected to some multiple of 4, so by the first two results, all even
numbers ≥ 4 are connected. The fourth fact proves that all numbers ≥ 3 are connected to some even
number at least 4, so all numbers at least 3 are connected.

Fourth Solution: As in the first solution, observe that if d > 2 and n is a multiple of d, then
n ↔ (d − 1)n.
Let us call a positive integer k safe if n ↔ kn for all n > 2. Notice that any product of safe numbers
is safe. Now, we claim that 2 is safe. To prove this, define f (n), for n > 2, to be the smallest divisor
of n that is greater than 2. We show that n ↔ 2n by strong induction on f (n). In case f (n) = 3, we
immediately have n ↔ 2n by our initial observation. Otherwise, notice that f (n) − 1 is a divisor of
(f (n) − 1)n that is greater than 2 and less than f (n). By the minimality of f , f ((f (n) − 1)n) < f (n),
and so the induction hypothesis gives (f (n) − 1)n ↔ 2(f (n) − 1)n. We also have n ↔ (f (n) − 1)n
(by our earlier observation) and 2(f (n) − 1)n ↔ 2n (by the same observation, because f (n) divides
n, and so f (n) divides 2n). Thus, n ↔ 2n. This completes the induction step and proves the claim.
Mathematics Olympiad Coachs Seminar, Zhuhai, China 7

Next, we show that any prime p is safe, again by strong induction. The base case p = 2 has already
been done. If p is an odd prime, then p + 1 is a product of primes strictly less than p, which are safe
by the induction hypothesis; hence, p + 1 is safe. Thus, for any n > 2,

n ↔ (p + 1)n ↔ p(p + 1)n ↔ pn.

This completes the induction step. Thus, all primes are safe, and hence every integer ≥ 2 is safe. In
particular, our given numbers a, b are safe, so we have a ↔ ab ↔ b, as needed.

12. Find all ordered triples of primes (p, q, r) such that

p | q r + 1, q | rp + 1, r | pq + 1.

Solution: Answer: (2, 5, 3) and cyclic permutations.


We check that this is a solution:

2 | 126 = 53 + 1, 5 | 10 = 32 + 1, 3 | 33 = 25 + 1.

Now let p, q, r be three primes satisfying the given divisibility relations. Since q does not divide
q r + 1, p 6= q, and similarly q 6= r, r 6= p, so p, q and r are all distinct. We now prove a lemma.
Lemma. Let p, q, r be distinct primes with p | q r + 1, and p > 2. Then either 2r | p − 1 or
p | q 2 − 1.
Proof: Since p | q r + 1, we have

q r ≡ −1 6≡ 1 (mod p), because p > 2,

but
q 2r ≡ (−1)2 ≡ 1 (mod p).

Let d be the order of q mod p; then from the above congruences, d divides 2r but not r. Since r is
prime, the only possibilities are d = 2 or d = 2r. If d = 2r, then 2r | p − 1 because d | p − 1. If d = 2,
then q 2 ≡ 1 (mod p) so p | q 2 − 1. This proves the lemma.
Now let’s first consider the case where p, q and r are all odd. Since p | q r + 1, by the lemma either
2r | p − 1 or p | q 2 − 1. But 2r | p − 1 is impossible because

2r | p − 1 =⇒ p ≡ 1 (mod r) =⇒ 0 ≡ pq + 1 ≡ 2 (mod r)

and r > 2. So we must have p | q 2 − 1 = (q − 1)(q + 1). Since p is an odd prime and q − 1, q + 1 are
both even, we must have p | q−1 q+1 q+1
2 or p | 2 ; either way, p ≤ 2 < q. But then by a similar argument
we may conclude q < r, r < p, a contradiction.
Thus, at least one of p, q, r must equal 2. By a cyclic permutation we may assume that p = 2. Now
r | 2q + 1, so by the lemma, either 2q | r − 1 or r | 22 − 1. But 2q | r − 1 is impossible as before,
because q divides r2 + 1 = (r2 − 1) + 2 and q > 2. Hence, we must have r | 22 − 1. We conclude
that r = 3, and q | r2 + 1 = 10. Because q 6= p, we must have q = 5. Hence (2, 5, 3) and its cyclic
permutations are the only solutions.
8 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

13. Find all pairs of nonnegative integers (m, n) such that

(m + n − 5)2 = 9mn.

Solution: The equation is symmetric in m and n. The solutions are the unordered pairs
2 2
(5F2k , 5F2k+2 ), (L22k−1 , L22k+1 ),

where k is a nonnegative integer and { Fj }, { Lj } are the Fibonacci and Lucas sequences, respec-
tively — that is, the sequences defined by F1 = F2 = 1, L1 = 1, L2 = 3, and the recursive relations
Fj+2 = Fj+1 + Fj and Lj+2 = Lj+1 + Lj for j ≥ 1. Note that we amended the Lucas sequence by
considering L1 = −1 and L0 = 2.
Let g = gcd(m, n) and write m = gm1 and n = gn1 . Because 9mn is a perfect square, m1 and n1
are perfect squares. Let m1 = x2 and n1 = y 2 . The given condition becomes

(gx2 + gy 2 − 5)2 = 9g 2 x2 y 2 .

Taking the square root on both sides yields

g(x2 + y 2 ) − 5 = ±3gxy,

or
g(x2 + y 2 ± 3xy) = 5.

If g(x2 + y 2 + 3xy) = 5, then x2 + y 2 + 3xy ≤ 5, implying that x = y = g = 1 and (m, n) = (1, 1).
Otherwise, g(x2 + y 2 − 3xy) = 5 and g = 1 or 5. Fix g equal to one of these values, so that
5
x2 − 3xy + y 2 = . (1)
g

We call an unordered pair (a, b) a g-pair if (x, y) = (a, b) (or equivalently, (x, y) = (b, a)) satisfies (1)
and a and b are positive integers. Also, we call an unordered pair (p, q) smaller (respectively, larger)
than another unordered pair (r, s) if p + q is smaller (respectively, larger) than r + s.
Suppose that (a, b) is a g-pair. View (1) as a monic quadratic in x with y = b constant. The coefficient
of x in a monic quadratic function (x − r1 )(x − r2 ) equals −(r1 + r2 ), implying that (3b − a, b) should
also satisfy (1). Indeed,
5
b2 − 3b(3b − a) + (3b − a)2 = a2 − 3ab + b2 = .
g
Also, if b > 2, note that
5
a2 − 3ab + b2 = < b2 .
g
It follows that a2 − 3ab < 0 and so 3b − a > 0. Thus, if (a, b) is a g-pair with b > 2, then (b, 3b − a)
is a g-pair as well. Also note that for a0 = b and b0 = 3b − a, (b0 , 3b0 − a0 ) = (a, b).
Furthermore, if a ≥ b, note that a 6= b because otherwise −a2 = g > 0, which is impossible. Thus,
a > b and
5
a2 − 3ab + b2 = > b2 − a2 ,
g
Mathematics Olympiad Coachs Seminar, Zhuhai, China 9

which implies that a(2a − 3b) > 0 and hence a + b > b + (3b − a) and also 3b − a > b. Thus, (b, 3b − a)
is a smaller g-pair than (a, b) with b ≥ 3b − a.
Given any g-pair (a, b) with b ≤ a, if b ≤ 2 then a must equal r(g), where r(5) = 3 if r(1) = 4.
Otherwise, according to the above observation we can repeatedly reduce it to a smaller g-pair until
min(a, b) ≤ 2 — that is, to the g-pair (r(g), 1).
Beginning with (r(g), 1), we reverse the reducing process so that (x, y) is replaced by the larger g-pair
(3x − y, x). Moreover, this must generate all g-pairs since all g-pairs can be reduced to (r(g), 1). We
may express these possible pairs in terms of the Fibonacci and Lucas numbers; for g = 1, observe
that L2 = 1, L3 = 4 = r(1), and that

L2k+3 = L2k+2 + L2k+1 = (L2k+1 + L2k ) + L2k+1


= (L2k+1 + (L2k+1 − L2k−1 )) + L2k+1
= 3L2k+1 − L2k−1

for k ≥ 0. For g = 5, the Fibonacci numbers satisfy an analogous recursive relation, and F2 = 1,
F4 = 3 = r(5). Therefore, (m, n) = (L22k−1 , L22k+1 ) and (m, n) = (5F2k
2 , 5F 2
2k+2 ) for k ≥ 0.

14. Find in explicit form all ordered pairs of positive integers (m, n) such that mn − 1 divides m2 + n2 .

Solution: Half of the answers are

(m` , n` ) = (a1 r1`+1 + a2 r2`+1 , a1 r1` + a2 r2` ) for ` = 0, 1, 2, . . . ,

and
(m` , n` ) = (a2 r1`+1 + a1 r2`+1 , a2 r1` + a1 r2` ) for ` = 0, 1, 2, . . . ,
where
√ √
5+ 21 5 − 21
r1 = , r2 = ;
2√ 2 √
21 − 21 21 + 21
a1 = , a2 = .
42 42
The other half of the solutions are obtained by reversing the above solutions.
Assume that (m, n) satisfies the conditions of the problem. Then there is a positive integer k such
that
k(mn − 1) = m2 + n2 . (1)
It is clear that (m, n) 6= (1, 1). Without loss of generality we may assume that m ≥ n. Then m ≥ 2.
Note that m 6= n: otherwise we would have k(m2 − 1) = 2m2 , but 2 < 2m2 /(m2 − 1) < 3 for m ≥ 2.
Hence we may assume that m ≥ n + 1. We consider the quadratic equation

x2 − knx + n2 + k = 0. (2)

Let x1 and x2 be the two solutions of (2). Then x1 x2 = n2 + k and x1 + x2 = kn. By equation (1),
equation (2) has an integer root x1 = m. Hence equation (2) has another integer root x2 = kn − m =
(n2 +k)/m. Because m, n, k > 0, x2 > 0. We claim that x2 < n if n ≥ 2. Indeed, n−x2 = n+m−kn,
so

(mn − 1)(n − x2 ) = (mn − 1)(m + n) − n(m2 + n2 )


= mn2 − m − n − n3 .
10 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Therefore, x2 < n if and only if m(n2 − 1) − n3 − n > 0.


If m ≥ n + 2, then
m(n2 − 1) − n3 − n ≥ (n + 2)(n2 − 1) − n3 − n = 2(n2 − n − 1) > 0,
implying that x2 < n.
If n ≥ 3 and m = n + 1, then
m(n2 − 1) − n3 − n = n2 − 2n − 1 > 0,
implying that x2 < n.
13
If n = 2 and m = 3, then k = 5 is not an integer, a contradiction.
From the above argument, we conclude that if (m, n), m > n ≥ 2, is pair of integers satisfying the
conditions of the problem, then there is another pair of positive integers (m0 , n0 ) = (n, kn − m),
m > n = m0 > n0 , also satisfying the conditions of the problem, where
m2 + n2 (m0 )2 + (n0 )2
k= = .
mn − 1 m0 n 0 − 1
We can repeat this process if n0 ≥ 2. Hence to find all pairs of positive integers (m, n) satisfying the
conditions of the problem, we may start by assuming n = 1. Then
m2 + 1 2
k= =m+1+ ,
m−1 m−1
implying that (m − 1) divides 2, that is, m = 2 or m = 3. In either case, we obtain k = 5. Therefore
all solutions can be reduced to either (1, 2) or (1, 3) via the transformation (m, n) → (n, 5n−m). Now
we can reverse this process by applying the inverse transformation (x, y) → (5x − y, x) repeatedly,
starting with either (2, 1) or (3, 1), to generate all solutions. Furthermore, all solutions can be
expressed as consecutive terms (xk+1 , xk ) or (yk+1 , yk ) of the sequences {xk }∞ ∞
k=0 and {yk }k=0 , given
by
xk+2 = 5xk+1 − xk and yk+2 = 5yk+1 − yk ,
where x0 = 1, x1 = 2 and y0 = 1, y1 = 3. In either case, because the characteristic polynomial
of the sequence is x2 − 5x + 1, with roots r1 and r2 , there exist coefficients a1 , a2 , b1 , b2 such that
xk = a1 r1k + a2 r2k and yk = b1 r1k + b2 r2k . Solving for a1 , a2 and b1 , b2 using the initial values x0 , x1 and
y0 , y1 gives the desired answers.
15. Let A be a finite set of positive integers. Prove that there exists a finite set B of positive integers
such that A ⊆ B and Y X
x= x2 .
x∈B x∈B

Solution: For any finite set S of positive integers, let


Y X
D(S) = x− x2 .
x∈S x∈S

If D(A) = 0, then we take B = A. If D(A) < 0, then let m = max A. Write A0k = A ∪ { m + 1, m +
2, . . . , m + k }. Then there is a positive integer k such that
−D(A) < (m + 1)k − (k 3 + 2mk 2 + m2 k)
= (m + 1)k − k(m + k)2 ≤ D(A0k ) − D(A)
Mathematics Olympiad Coachs Seminar, Zhuhai, China 11

and hence D(A0k ) > 0. Thus, it suffices to find a finite set B containing A0 such that D(B) = 0,
because then B contains A as well. This reduces the problem to the next and final case.
nQ o
Assume that D(A) > 0, and write A0 = A. Define Ak+1 = Ak ∪ x∈Ak x − 1 recursively for
k = 0, 1, . . . , D(A) − 1. If D(Ak ) > 0, we have Ak 6= { 1} and hence
X Y Y
max Ak < x2 = x − D(Ak ) < x.
x∈Ak x∈Ak x∈Ak
Q
Therefore, x∈Ak x − 1 > max Ak and Ak+1 has one more element than Ak . It follows that
Y X
D(Ak+1 ) = x− x2
x∈Ak+1 x∈Ak+1
Y Y X Y
= x( x − 1) − x2 − ( x − 1)2
x∈Ak x∈Ak x∈Ak x∈Ak
Y X
= x− x2 − 1 = D(Ak ) − 1.
x∈Ak x∈Ak

Because D(A0 ) > 0, it follows that D(Ak ) = D(A) − k > 0 for k < D(A) and that D(AD(A) ) = 0.
Taking B = AD(A) completes the proof.

16. Let P (x) be a polynomial with integer coefficients. The integers a1 , a2 , . . . , an have the following
property: for any integer x there exists an 1 ≤ i ≤ n such that P (x) is divisible by ai . Prove that
there is an 1 ≤ i0 ≤ n such that ai0 divides P (x) for any integer x.

Solution: Assume that the claim is false. Then for each i = 1, 2, . . . , n there exists an integer
xi such that P (xi ) is not divisible by ai . Hence there is a prime power pki i which divides ai and does
not divide P (xi ). Some of powers of pki 1 , pk22 , . . . , pknn may have the same base. If so, ignore them all
but the one with the least exponent. To simplify the notation, assume the the sequence obtained
this way is pki 1 , pk22 , . . . , pkmm , m ≤ n and p1 , p2 , . . . , pm are distinct. Note that each ai is divisible by
some term of this sequence.
Since pki 1 , pk22 , . . . , pkmm are pairwise relative prime, the Chinese remainder theorem yields a solu-
tion of the simultaneous congruences

x ≡ x1 (mod pk11 ), x ≡ x2 (mod pk12 ), ..., x ≡ xm (mod pkmm ).


k k
Now since P (x) is an integer polynomial, x ≡ xi (mod pj j ) implies that P (x) ≡ P (xi ) (mod pj j ),
for each i = 1, 2, . . . , m. Then none of the numbers pki 1 , pk22 , . . . , pkmm divided P (x). But each ai is
k
divisible by pj j for some 1 ≤ j ≤ m, It follows that no ai divides P (x), a contradiction.

17. Determine (with proof) whether there is a subset X of the integers with the following property: for
any integer n there is exactly one solution of a + 2b = n with a, b ∈ X.

First Solution: Yes, there is such a subset. If the problem is restricted to the nonnegative
integers, it is clear that the set of integers whose representations in base 4 contains only the digits
0 and 1 satisfies the desired property. To accommodate thePnegative integers as well, we switch to
“base −4”. That is, we represent every integer in the form ki=0 ci (−4)i , with ci ∈ {0, 1, 2, 3} for all
i and ck 6= 0, and let X be the
12 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

set of numbers whose representations use only the digits 0 and 1. This X will again have the desired
property, once we show that every integer has a unique representation in this fashion.
To show base −4 representations are unique, let {ci } and {di } be two distinct finite sequences of
elements of {0, 1, 2, 3}, and let j be the smallest integer such that cj 6= dj . Then
k
X k
X
ci (−4)i 6≡ di (−4)i (mod 4j ),
i=0 i=0

so in particular the two numbers represented by {ci } and {di } are distinct. On the other hand, to
show that n admits a base −4 representation,
P2k find an integer k such that 1 + 42 + · · · + 42k ≥ n and
express n + 4 + · · · + 42k−1 i
as i=0 ci 4 . Now set d2i = c2i and d2i−1 = 3 − c2i−1 , and note that
P2k i
n = i=0 di (−4) .

Second Solution: For any S ⊂ Z, let S ∗ = {a + 2b| a, b ∈ S}. Call a finite set of integers
S = {a1 , a2 , . . . , am } ⊂ Z good if |S ∗ | = |S|2 , i.e., if the values ai + 2aj (1 ≤ i, j ≤ m) are distinct.
We first prove that given a good set and n ∈ Z, we can always find a good superset T of S such that
n ∈ T ∗ . If n ∈ S ∗ already, take T = S. Otherwise take T = S ∪ {k, n − 2k} where k is to be chosen.
Then put T ∗ = S ∗ ∪ Q ∪ R, where

Q = {3k, 3(n − 2k), k + 2(n − 2k), (n − 2k) + 2k}

and
R = {k + 2ai , (n − 2k) + 2ai , ai + 2k, ai + 2(n − 2k)| 1 ≤ i ≤ m}.
Note that for any choice of k, we have n = (n − 2k) + 2k ∈ Q ⊂ T ∗ . Except for n, the new values
are distinct nonconstant linear forms in k, so if k is sufficiently large, they will all be distinct from
each other and from the elements of S ∗ . This proves that T ∗ is good.
Starting with the good set X0 = {0}, we thus obtain a sequence of sets X1 , X2 , X3 , . . . such that for
each positive integer j, Xj is a good superset of Xj−1 and Xj∗ contains the jth term of the sequence
1, −1, 2, −2, 3, −3, . . . . It follows that

[
X= Xj
j=0

has the desired property.

18. Suppose the sequence of nonnegative integers a1 , a2 , . . . , a1997 satisfies

ai + aj ≤ ai+j ≤ ai + aj + 1

for all i, j ≥ 1 with i + j ≤ 1997. Show that there exists a real number x such that an = bnxc for all
1 ≤ n ≤ 1997.

Solution: Any x that lies in all of the half-open intervals


· ¶
an an + 1
In = , , n = 1, 2, . . . , 1997
n n
will have the desired property. Let
an ap an + 1 aq + 1
L= max = and U= min = .
1≤n≤1997 n p 1≤n≤1997 n q
Mathematics Olympiad Coachs Seminar, Zhuhai, China 13

We shall prove that


an am + 1
< ,
n m
or, equivalently,
man < n(am + 1) (∗)
for all m, n ranging from 1 to 1997. Then L < U , since L ≥ U implies that (∗) is violated when
n = p and m = q. Any point x in [L, U ) has the desired property.
We prove (∗) for all m, n ranging from 1 to 1997 by strong induction. The base case m = n = 1
is trivial. The induction step splits into three cases. If m = n, then (∗) certainly holds. If m > n,
then the induction hypothesis gives (m − n)an < n(am−n + 1), and adding n(am−n + an ) ≤ nam
yields (∗). If m < n, then the induction hypothesis yields man−m < (n − m)(am + 1), and adding
man ≤ m(am + an−m + 1) gives (∗).

19. Let p be a prime number, and let m and n be integers greater than 1. Suppose that mp(n−1) − 1 is
divisible by n. Show that mn−1 − 1 and n have a common divisor greater than 1.

Solution: For each prime divisor q of n, compute the exponent of p in the prime factorization
of q − 1, and let q0 be a prime for which this quantity is minimized. Let k be the exponent of p
in the prime factorization of q0 − 1; then n ≡ 1 (mod pk ) and q0 6≡ 1 (mod pk+1 ). In particular,
the greatest common divisor of p(n − 1) and q0 − 1 is divisible by pk but not by pk+1 , and so also
divides n − 1. Therefore, there exist integers r and s so that rp(n − 1) + s(q0 − 1) = n − 1; since
mp(n−1) ≡ mq0 −1 ≡ 1 (mod q0 ), we deduce mn−1 ≡ 1 (mod q0 ). We conclude that mn−1 − 1 and n
have the common factor q0 .

Note: This problem generalizes a problem from MOP 1997: show that 2n−1 ≡ −1 (mod n) for n
a positive integer only if n = 1. (Set m = p = 2 in the current problem to recover this conclusion.)

20. Starting from a triple (a, b, c) of nonnegative integers, a move consists of choosing two of them, say
x and y, and replacing one of these by either x + y or |x − y|. For example, one can go from (3, 5, 7)
to (3, 5, 4) in one move. Prove that there exists a constant r > 0 such that whenever a, b, c, n are
positive integers with a, b, c < 2n , there is a sequence of at most rn moves transforming (a, b, c) into
(a0 , b0 , c0 ) with a0 b0 c0 = 0.

Solution: We will use strong induction on n to show that r = 12 works. The bases is trivial.
Without loss of generality, we assume that a ≤ b ≤ c. Using two moves if necessary to replace a by
c − a and b by c − b, we may instead assume that 0 ≤ a ≤ b ≤ c/2. let m be the integer such that
2m−1 ≤ b < 2m . Since 1 ≤ b ≤ c/2 < 2n−1 , we have 1 ≤ m ≤ n − 1. Define a sequence x0 = a, x1 = b,
and xk = xk−1 + xk−2 for k ≥ 2.

Lemma Every integer y ≥ b can be expressed in the form

² + xii + · · · + xi`

where 0 ≤ ² < b and i1 < i2 < · · · < i` and xi` ≤ y < xi` +1 .

Proof: Since xi are increasing, there is a unique i ≥ 1 for which xi ≤ y < xi+1 . We use strong
induction on i. If y − xi < b, we let ² = y − xi and we are done. Otherwise x1 = b ≤ y − xi <
14 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

xi+1 − xi = xi−1 so there is a unique j ≥ 1 such that xi ≤ y − xi < xj+1 , and j < i, so we finish by
applying the inductive hypothesis to y − xi .
Write c = ² + xi1 + · · · + xi` , where 0 ≤ ² < b and 0 < i1 < · · · < i` . Since xk+2 = xk+1 + xk =
2xk + xk−1 ≥ 2xk for k ≥ 1, we have

x2n−2m+3 ≥ 2n−m+1 x1 ≥ 2n−m+1 2m−1 = 2n > c,

so i1 < i2 < · · · < i` < 2n − 2m + 3.


Using 2n − 2m + 1 addition moves we can change (a, b, c) = (x0 , x1 , c) into (x2 , x1 , c), then into
(x2 , x3 , c), and so on, until we reach (x2n−2m+2 , x2n−2m+1 , c). If instead intersperse at most 2n−2m+2
moves between these to subtract from c the xij in the representation of c as they produced in the
first two coordinates, we will eventually reduce c to ². Now we can perform 2n − 2m + 1 substraction
moves to change (x2n−2m+2 , x2n−2m+1 back to (x2n−2m , x2n−2m+1 ), and so on, undoing the previous
operations on the first two coordinates, until we end up with the triple a, b, ²).
Reaching (a, b, ²) required at most

2 + (2n − 2m + 1) + (2n − 2m + 2) + (2n − 2m + 1) = 6n − 6m + 6

moves. Afterwards, since a, b, ² < 2m , we can transform (a, b, c) into a triple with a zero in at most
12m more moves, by the inductive hypothesis, for a total of (6n − 6m + 6) + 12m = 6n + 6m + 6, 12m
moves, since m ≤ n − 1.

21. Let S be a set of integers (not necessarily positive) such that

(a) there exist a, b ∈ S with gcd(a, b) = gcd(a − 2, b − 2) = 1;


(b) if x and y are elements of S (possibly equal), then x2 − y also belongs to S.

Prove that S is the set of all integers.

First Solution: In the solution below we use the expression S is stable under x 7→ f (x) to
mean that if t belongs to S, then f (t) also belongs to S. If c, d ∈ S, then by condition (b), S is
stable under x 7→ c2 − x and x 7→ d2 − x. Hence, it is stable under x 7→ c2 − (d2 − x) = x + (c2 − d2 ).
Similarly, S is stable under x 7→ x + (d2 − c2 ). Hence, S is stable under x 7→ x + n and x 7→ x − n,
whenever n is an integer linear combination of finitely many numbers in T = { c2 − d2 | c, d ∈ S }.
By condition (a), S 6= ∅ and hence T 6= ∅ as well. For the sake of contradiction, assume that some
p divides every element in T. Then c2 − d2 ≡ 0 (mod p) for all c, d ∈ S. In other words, for each
c, d ∈ S, either d ≡ c (mod p) or d ≡ −c (mod p). Given c ∈ S, c2 − c ∈ S, by condition (b), so
c2 − c ≡ c (mod p) or c2 − c ≡ −c (mod p). Hence,

c ≡ 0 (mod p) or c ≡ 2 (mod p) (∗)

for each c ∈ S. By condition (a), there exist some a and b in S such that gcd(a, b) = 1, that is, at
least one of a or b cannot be divisible by p. Denote such an element of S by α; thus, α 6≡ 0 (mod p).
Similarly, by condition (a), gcd(a − 2, b − 2) = 1, so p cannot divide both a − 2 and b − 2. Thus, there
is an element of S, call it β, such that β 6≡ 2 (mod p). By (∗), α ≡ 2 (mod p) and β ≡ 0 (mod p).
By condition (b), β 2 − α ∈ S. Taking c = β 2 − α in (∗) yields either −2 ≡ 0 (mod p) or −2 ≡ 2
(mod p), so p = 2. Now (∗) says that all elements of S are even, contradicting condition (a). Hence,
our assumption is false and no prime divides every element in T.
Mathematics Olympiad Coachs Seminar, Zhuhai, China 15

It follows that T 6= { 0}. Let x be an arbitrary nonzero element of T. For each prime divisor of x,
there exists an element in T which is not divisible by that prime. The set A consisting of x and each
of these elements is finite. By construction, m = gcd{ y | y ∈ A } = 1, and m can be written as
an integer linear combination of finitely many elements in A and hence in T. Therefore, S is stable
under x 7→ x + 1 and x 7→ x − 1. Because S is nonempty, it follows that S is the set of all integers.

Second Solution: Define T, a, and b as in the first solution. We present another proof that
no prime divides every element in T. Suppose, for sake of contradiction, that such a prime p does
exist. By condition (b), a2 − a, b2 − b ∈ S. Therefore, p divides a2 − b2 , x1 = (a2 − a)2 − a2 , and
x2 = (b2 − b)2 − b2 . Because gcd(a, b) = 1, both gcd(a2 − b2 , a3 ) and gcd(a2 − b2 , b3 ) equal 1, so p does
not divide a3 or b3 . But p does divide x1 = a3 (a − 2) and x2 = b3 (b − 2), so it must divide a − 2 and
b − 2. Because gcd(a − 2, b − 2) = 1 by condition (a), this implies p | 1, a contradiction. Therefore
our original assumption was false, and no such p exists.

22. For a set S, let |S| denote the number of elements in S. Let A be a set of positive integers with
|A| = 2001. Prove that there exists a set B such that

(i) B ⊆ A;
(ii) |B| ≥ 668;
(iii) for any u, v ∈ B (not necessarily distinct), u + v 6∈ B.

First Solution: (By Reid Barton) For a positive integer n, let Zn denote the set of residues
modulo n. Let φ(n) be the Euler function which is defined to be the number of integers between
1 and n relatively prime to n. Call a set A of residues modolo 3n sum-free if for any a, b ∈ A, a + b
is not (congruent to) an element of A.
Lemma. For any n ≥ 1, there exist 3n − 1 sum-free sets of 3n−1 residues modulo 3n such that
every nonzero residue modulo 3n appears in exactly 3n−1 of the subsets.
Proof: We construct the desired subsets inductively. For n = 1 we take the sets { 1} and { 2}.
Let n ≥ 1, and suppose that the statement holds for n, that is, we have 3n − 1 sum-free subsets A1 ,
A2 , . . . , A3n −1 of Z3n such that every element of Z3n belongs to exactly 3n−1 of the Ai . Construct
sets B1 , B2 , . . . , B3n −1 by

Bi = { x ∈ Z3n+1 kx ≡ m0 (mod 3)n , m0 ∈ Ai }.

Then each Bi contains 3|Ai | = 3n residues, and the Bi are sum-free, because if a, b ∈ Bi , (a+b) mod 3n
is not in Ai so a + b is not in Bi . Moreover, each element x of Z3n+1 which is not 0 modulo 3n (i.e.,
all elements except 0, 3n , 2 · 3n ) is in exactly 3n−1 of the Bi , namely those corresponding to the Ai
containing x mod 3n .
Now define sets
C = { 3n , 3n + 1, . . . , 2 · 3n − 1 }
and
U = { x ∈ Z3n+1 k gcd(x, 3) = 1 }.
Then C ⊂ Z3n+1 , |C| = 3n . Note that C is sum-free, because if a, b ∈ C with 3n ≤ a, b < 2 · 3n then
2 · 3n ≤ a + b < 4 · 3n so a + b is not congruent modulo 3n+1 to an element of C. For each y ∈ U , let
Cy = yC = { yxkx ∈ C }. Then Cy is also sum-free for every y ∈ U , because if we had ya and yb in
16 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Cy with ya + yb ∈ Cy , then a and b would be elements of C summing to an element of C. Also, every


Cy contains |C| = 3n residues because multiplication by y is invertible. Since |U | = φ(3n+1 ) = 2 × 3n ,
there are 2 · 3n of sets Cy ’s.
Consider the sets

B1 , B2 , . . . , B3n −1 , C1 , C2 , C4 , C5 , C7 , . . . , C3n+1 −2 , C3n+1 −1 .

There are 3n − 1 + 2 · 3n = 3n+1 − 1 of these sets, so it suffices to check that every nonzero residue
modulo 3n+1 appears in exactly 3n of them. Let m be a nonzero residue modulo 3n+1 , and write
m = 3k s, 0 ≤ k ≤ n, gcd(s, 3) = 1. We consider two cases.

(i) k < n. Then m is a nonzero residue modulo 3n , so m is contained in exactly 3n−1 of the
sets Bi , namely those which correspond to Ai with m0 ∈ Ai (where m ≡ m0 (mod 3)n ). The
number of sets Ci containing m is the number of solutions to y −1 m ∈ C with y ∈ U , or the
number of z ∈ U such that zm ∈ C. Since m 6= 0, as z ranges over Z3n+1 , one third of the
residues zm are in C; likewise, since 3m 6= 0, one third of the residues 3zm are in C. Since
U = Z3n+1 \ 3Z3n+1 , zm ∈ C for one third of the values z ∈ U . So m is in one third of the sets
Cy , giving 31 |U | = 2 · 3n−1 more sets containing m. The total number of sets containing m is
then 3n−1 + 2 · 3n−1 = 3n .
(ii) k = n. Then m = 3n or 2 · 3n (s = 1 or 2 respectively). Then m mod 3n = 0, so m does not
appear in any of the sets Ai . However, m appears in every set Cy with y ≡ s (mod 3), so m
appears in 3n of the Cy . Thus the total number of sets containing m is again 3n .

Thus the sets { Bi }, { Cy } have the desired properties and the Lemma holds by induction.
Now let 3n be a power of 3 larger than the sum of any two elements of A. By the Lemma, there
exist 3n − 1 sets S1 , . . . , S3n −1 of 3n−1 residues modulo 3n such that every nonzero residue modulo
3n appears in exactly 3n−1 of the Si . Let ni be the number of elements of A contained in Si . Since
every element of A appears 3n−1 times,
n −1
3X
ni = 3n−1 |A|
i=1

so some ni is at least
3n−1 |A| 1 2001
> |A| = = 667.
3n − 1 3 3
Let B be the set of elements of A contained in Si . Then |B| ≥ 668, and if u, v ∈ B, then u + v ∈
/ B,
because Si is sum-free. Thus the set B has the desired properties.

Second Solution: Let the elements of A be a1 , . . . , a2001 . Let p be a prime number such that
p ≡ 2 (mod 3) and p is larger than all the ai . Such a prime p exists by Dirichlet’s Theorem,
although the result can also be easily proven directly. There is at least one prime congruent to 2
modulo 3 (namely, 2). Suppose there were only finitely many primes congruent to 2 modulo 3, and
let their product be P . Then 3P − 1, which is larger than P and congruent to 2 modulo 3, must
have another prime divisor congruent to 2 modulo 3, contradiction. Thus, the original assumption
was wrong, and there are infinitely many odd primes that are congruent to 2 modulo 3. Specifically,
one such prime is larger than all ai .
Mathematics Olympiad Coachs Seminar, Zhuhai, China 17

All elements of S are distinct and nonzero modulo p. Call a number n mediocre if the least positive
residue of n modulo p lies in [(p + 1)/3, (2p − 1)/3]. For any 1 ≤ i ≤ 2001, there are exactly (p + 1)/3
integer values of k ∈ [1, p − 1] such that kai is mediocre. Thus, there are
2001(p + 1)
= 667(p + 1)
3
pairs of (k, i) such that kai is mediocre. By the Pigeonhole Principle, there exists some k for
which the set
B = { ai | kai is mediocre }
has at least 668 elements.
We now claim that this B satisfies the desired properties. It suffices to show that k times the sum
of any two elements of B is not mediocre and hence cannot equal k times any element of B. To
that end, note that k times the sum of any two elements of B cannot be mediocre because it is
congruent modulo p to some number in [2(p + 1)/3, 2(2p − 1)/3] or, equivalently, to some number in
[0, (p − 2)/3] ∪ [(2p + 2)/3, p − 1], which is a set containing no mediocre numbers. Thus, the set B
satisfies the desired properties.

23. For a given prime p, find the greatest positive integer n with the following property: the edges of the
complete graph on n vertices can be colored with p + 1 colors so that:

(a) at least two edges have different colors;


(b) if A, B, and C are any three vertices and the edges AB and AC are of the same color, then BC
has the same color as well.

Solution: Let n be a number having the given property, and let edges of the complete graph
with n vertices be colored in p + 1 colors denoted 1, 2, . . . , p + 1 so that the given conditions hold.
Consider an arbitrary vertex A1 . Denote by xi the number of edges with endpoint A1 colored in the
color i. Then, of course,
x1 + x2 + · · · + xp+1 = n − 1. (1)
Invoking the Pigeonhole principle, we are going to show that

xi ≤ p − 1 for each i = 1, 2, . . . p + 1. (2)

Assume (2) is not true. Without loss of generality, let the edges A1 A2 , A1 A3 , . . . A1 Ap+1 be of the
ith color. Then, according (b), each of he edges Ak A` , 2 ≤ k < ` ≤ p + 1, is of the ith color as well.
Take any vertex B of the graph. At least one of the p + 1 edges BA1 , BA2 , . . . , BAp+1 is of the ith
color: otherwise, one of the other p colors would double up, making two edges BAk and BA` both
the same color m 6= i. But then (b) imply that Ak A` is of the mth color, a contradiction.
Thus the edge BAj is of the ith color for some j = 1, 2, . . . , p + 1. Then since BAj and Aj Ak are of
color i, it follows that BAk is also in color i, and this is true for all k = 1, 2, . . . , p + 1. The vertex B
was chosen arbitrarily, so the same result applies to any other vertex C. Then using (b) for the last
time, we obtain that any edge BC is of the ith color, and this contradicts (a).
Thus we proved (2) which, combined with (1), gives

n − 1 = x1 + x2 + · · · + xp+1 ≤ (p + 1)(p − 1) = p2 − 1.

This means n ≤ p2 . Note that this conclusion holds regardless of whether or not p is a prime.
18 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

The Pigeonhole principle did its job. Now we have to point out an example proving that the edges
of the complete graph G with p2 vertices can be colored in p + 1 colors so that (a) and (b) hold.
The construction is indeed a very nice one. Regard the vertices of G as ordered pairs (i, j) where
0 ≤ i, j ≤ p−1. Let A1 = (a1 , b1 ) and A2 = (a2 , b2 ) be vertices of G. if b1 6= b2 , then gcd(b1 −b2 , p) = 1
as p is a prime. Then the congruence

(b1 − b2 )x = a1 − a2 (mod p)

has a unique solution x = i in the set {0, 1, 2, . . . , p − 1}. In this case, color edges A1 A2 with color
i + 1. If b1 = b2 , then color this edge with color p + 1. Thus the edges of G are colored with p + 1
edges. The condition (a) holds for trivial reasons, and (b) follows from the transitive property of
congruence.
Hence the greatest number with the desired property is p2 .
24. Let p > 2 be a prime and let a, b, c, d be integers not divisible by p, such that

{ra/p} + {rb/p} + {rc/p} + {rd/p} = 2

for any integer r not divisible by p. Prove that at least two of the numbers a + b, a + c, a + d, b + c,
b + d, c + d are divisible by p. (Note: {x} = x − bxc denotes the fractional part of x.)

Solution: For convenience, we write [x] for the unique integer in {0, . . . , p − 1} congruent to
x modulo p. In this notation, the given condition can be written

[ra] + [rb] + [rc] + [rd] = 2p for all r not divisible by p. (1)

The conditions of the problem are preserved by replacing a, b, c, d with ma, mb, mc, md for any integer
m relatively prime to p. If we choose m so that ma ≡ 1 (mod p) and then replace a, b, c, d with
[ma], [mb], [mc], [md], respectively, we end up in the case a = 1 and b, c, d ∈ {1, . . . , p − 1}. Applying
(1) with r = 1, we see moreover that a + b + c + d = 2p.
Now observe that ½
[x] [rx] < p − [x]
[(r + 1)x] − [rx] =
−p + [x] [rx] ≥ p − [x].
Comparing (1) applied to two consecutive values of r and using the observation, we see that for each
r = 1, . . . , p − 2, two of the quantities

p − a − [ra], p − b − [rb], p − c − [rc], p − d − [rd]

are positive and two are negative. We say that a pair (r, x) is positive if [rx] < p − [x] and negative
otherwise; then for each r < p − 1, (r, 1) is positive, so exactly one of (r, b), (r, c), (r, d) is also positive.
Lemma If r1 , r2 , x ∈ {1, . . . , p − 1} have the property that (r1 , x) and (r2 , x) are negative but (r, x)
is positive for all r1 < r < r2 , then
jpk jpk
r2 − r1 = or r2 − r1 = + 1.
x x

Proof: Note that (r0 , x) is negative if and only if {r0 x + 1, r0 x + 2, . . . , (r0 + 1)x} contains a multiple
of p. In particular, exactly one multiple of p lies in {r1 x, r1 x + 1, . . . , r2 x}. Because [r1 x] and [r2 x]
are distinct elements of {p − [x], . . . , p − 1}, we have

p − x + 1 < r2 x − r1 x < p + x − 1,
Mathematics Olympiad Coachs Seminar, Zhuhai, China 19

from which the lemma follows.

[rx] 9 10 0 1 2 3 4 5 6 7 8 9 10 0
is (r, x) + or –? − + + + −
r 3 4 5 6 7

(The above diagram illustrates the meanings of positive and negative in the case x = 3 and p = 11. Note that
the difference between 7 and 3 here is b xp c + 1. The next r such that (r, x) is negative is r = 10; 10 − 7 = b xp c.)
Recall that exactly one of (1, b), (1, c), (1, d) is positive; we may as well assume (1, b) is positive,
which is to say b < p2 and c, d > p2 . Put s1 = b pb c, so that s1 is the smallest positive integer such
that (s1 , b) is negative. Then exactly one of (s1 , c) and (s1 , d) is positive, say the former. Because s1
is also the smallest positive integer such that (s1 , c) is positive, or equivalently such that (s1 , p − c)
p
is negative, we have s1 = b p−c c. The lemma states that consecutive values of r for which (r, b) is
negative differ by either s1 or s1 + 1. It also states (when applied with x = p − c) that consecutive
values of r for which (r, c) is positive differ by either s1 or s1 + 1. From these observations we will
show that (r, d) is always negative.

?
r 1 s1 s1 + 1 s0 s0 + 1 s s+1=t
(r, b) + − + − + − −?
(r, c) − ... + − ... + − ... − +?
(r, d) − − − − − + −?

Indeed, if this were not the case, there would exist a smallest positive integer s > s1 such that (s, d)
is positive; then (s, b) and (s, c) are both negative. If s0 is the last integer before s such that (s0 , b) is
negative (possibly equal to s1 ), then (s0 , d) is negative as well (by the minimal definition of s). Also,

s − s0 = s1 or s − s0 = s1 + 1.

Likewise, if t were the next integer after s0 such that (t, c) were positive, then

t − s0 = s1 or t − s0 = s1 + 1.

From these we deduce that |t − s| ≤ 1. However, we can’t have t 6= s because then both (s, b) and
(t, b) would be negative — and any two values of r for which (r, b) is negative differ by at least
s1 ≥ 2, a contradiction. (The above diagram shows the hypothetical case when t = s + 1.) Nor can
we have t = s because we already assumed that (s, c) is negative. Therefore we can’t have |t − s| ≤ 1,
contradicting our findings and thus proving that (r, d) is indeed always negative.
Now if d 6= p − 1, then the unique s ∈ {1, . . . , p − 1} such that [ds] = 1 is not equal to p − 1; and
(s, d) is positive, a contradiction. Thus d = p − 1 and a + d and b + c are divisible by p, as desired.

25. For real number x, let dxe denote the smallest integer greater than or equal to x, let bxc denote the
greatest integer less than or equal to x, and let {x} denote the fractional part of x, which is given
by x − bxc. Let p be a prime number. For integers r, s such that rs(r2 − s2 ) is not divisible by p, let
f (r, s) denote the number of integers n ∈ {1, 2, . . . , p − 1} such that {rn/p} and {sn/p} are either
both less than 1/2 or both greater than 1/2. Prove that there exists N > 0 such that for p ≥ N and
all r, s, » ¼ ¹ º
p−1 2(p − 1)
≤ f (r, s) ≤ .
3 3
20 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Solution: We assume that p is sufficiently large. Since f (r, s) = f (br, bs) for any b not divisible by
p, we may assume r = 1 and simply write f (s) instead of f (r, s). Also notice that f (s) = p−1−f (−s),
so we may assume 1 ≤ s ≤ (p − 1)/2. Moreover, s = 1 is forbidden, f (2) = (p − 1)/2 or (p − 3)/2,
and one easily checks that f (3) = b2(p − 1)/3c. So we may assume s ≥ 4.
Let g1 (s) be the number of a ∈ {1, . . . , (p − 1)/2} such that {as/p} < 1/2; and let g2 (s) be the
number of a ∈ {(p + 1)/2, . . . , p − 1} such that {as/p} > 1/2. Note that

{as/p} + {(p − a)s/p} = 1.

Thus g1 (s) = g2 (s) = f (s)/2. We consider two cases.

(a) s ∈ [4, p/4]. Note that


¯ ¯ ¯ µ ¶¯
¯ ¯ ¯ ¯
¯f (s) − p − 1 ¯ = ¯g1 (s) − p − 1 − g1 (s) ¯ ≤ s + p .
¯ 2 ¯ ¯ 2 ¯ 2 2s

To see this, divide s, 2s, . . . , (p−1)s/2 into groups depending on which of the intervals (0, p), (p, 2p), . . .
they fall into. In each group except the last one, at most one more number falls into one half
of the interval than into the other half. Since the largest of these numbers is less than sp/2,
the number of such groups is at most s/2. In the last group, the maximum discrepancy is the
greatest quantity of the numbers that fit into one half of the interval, which is at most p/2s.
For s ∈ [4, p/4], the right side of the above inequality achieves its maximum value at the
endpoints of the interval. Thus we get the upper bound
¯ ¯
¯ ¯
¯f (r, s) − p − 1 ¯ ≤ 2 + p
¯ 2 ¯ 8
and the right side is less than (p − 1)/6 for p sufficiently large.
(b) s ∈ ((p − 1)/4, (p − 1)/2]. In this case, there cannot exist three consecutive values of a ∈
{1, . . . , (p − 1)/2} or three consecutive values of a ∈ {(p + 1)/2, . . . , p − 1} such that the three
values of {as/p} all lie in a single interval of length 1/2. For p ≡ 1 (mod 6) this implies
d(p − 1)/3e ≤ f (s) ≤ b2(p − 1)/3c; for p ≡ 5 (mod 6), the lower bound is true. To violate the
upper bound, f (s) ≥ 4k + 3 where p = 6k + 5. Since f (s) = 2g2 (s), g2 (s) ≥ 2k + 2. But we can
regroup 3k + 2 numbers {1, 2, . . . , (p − 1)/2} as

{(1, 2), (3, 4, 5), . . . , (3k, 3k + 1, 3k + 2)} .


| {z }
k+1 groups

From the earlier observation, each group can provide at most two a’s such that {as/p} < 1/2.
Hence {s/p}, {2s/p} < 1/2. Since 1 ≤ s ≤ (p − 1)/2, {2s/p} = 2s/p. But then s/p < 1/4 and
4s < p. Now p > 4s > p − 1, which is impossible for integers s and p.

Note: Paul Valiant noted that one can alternatively treat the case s > (p − 1)/4 by a more
careful analysis of the group sizes, particularly in the neighborhood of (p − 1)/3.
The assertion of the problem holds in fact for all p ≥ 5 (note that the assertion is vacuous for p = 2, 3);
furthermore, equality holds if and only if r ≡ ±3s (mod p) or s ≡ ±3r (mod p).
The result is the main step in the solution of the following problem, posed recently by Greg Martin.
Fix a prime number p. I choose 3 integers a1 , a2 , a3 not divisible by p and no two congruent modulo
Mathematics Olympiad Coachs Seminar, Zhuhai, China 21

p. You then choose an integer r not divisible by p, and then collect from me a number of dollars
equal to the smallest positive integer congruent to one of ra1 , ra2 , ra3 modulo p. What is the smallest
amount I will have to pay out, and how do I achieve this minimum? (The corresponding question
for k integers instead of 3 is open, and the proposer offers $15 for its solution.)

26. Is it possible to select 102 17-element subsets of a 102-element set, such that the intersection of any
two of the subsets has at most 3 elements?

Solution: The answer is “yes.” More generally, suppose that p is a prime congruent to 2 modulo
3. We show that it is possible to select p(p + 1)/3 p-element subsets of a p(p + 1)/3-element set, such
that the intersection of any two of the subsets has at most 3 elements. Setting p = 17 yields the
claim.
Let P be the projective plane of order p (which this solution refers to as “the projective plane,” for
short), defined as follows. Let A be the ordered triples (a, b, c) of integers modulo p, and define the
equivalence relation ∼ by (a, b, c) ∼ (d, e, f ) if and only if (a, b, c) = (dκ, eκ, f κ) for some κ. Then
let P = (A − {(0, 0, 0)}) / ∼. We let [a, b, c] ∈ P denote the equivalence class containing (a, b, c), and
we call it a point of P. Because A − {(0, 0, 0)} contains p3 − 1 elements, and each equivalence class
under ∼ contains p − 1 elements, we find that |P| = (p3 − 1)/(p − 1) = p2 + p + 1.
Given q ∈ P, we may write q = [α, β, γ] and consider the solutions [x, y, z] to

αx + βy + γz ≡ 0 (mod p).

The set of these solutions is called a line in the projective plane; it is easy to check that this line is
well-defined regardless of how we write q = [α, β, γ], and that (x, y, z) satisfies the above equation if
and only if every triple in [x, y, z] does. We let [[α, β, γ]] denote the above line.
It is easy to check that P is in one-to-one correspondence with P ∗ , the set of lines in the projective
plane, via the correspondence [α, β, γ] ←→ [[α, β, γ]]. It is also easy to check that any two distinct
points lie on exactly one line, and that any two distinct lines intersect at exactly one point. Fur-
thermore, any line contains exactly p + 1 points. (The projective plane is not an invention of this
solution, but a standard object in algebraic geometry; the properties described up to this point are
also well known.)
Define ϕ : P → P by ϕ([a, b, c]) = [b, c, a]. Given a point q ∈ P, we say we rotate it to obtain q 0 if
q 0 = ϕ(q). Similarly, given a subset T ⊆ P, we say we rotate it to obtain T 0 if T 0 = ϕ(T ).
Given a point q 6= [1, 1, 1] in the projective plane, we rotate it once and then a second time to obtain
two additional points. Together, these three points form a triplet. We will show below that (i) the
corresponding triplet actually contains three points. Observe that any two triplets obtained in this
manner are either identical or disjoint. Because there are p2 + p points in P − {[1, 1, 1]}, it follows
that there are p(p + 1)/3 distinct triplets. Let S be the set of these triplets.
Given a line ` = [[α, β, γ]] 6= [[1, 1, 1]] in the projective plane, it is easy to show that rotating it once
and then a second time yields the lines [[β, γ, α]] and [[γ, α, β]]. The points q 6= [1, 1, 1] on [[α, β, γ]],
[[β, γ, α]], and [[γ, α, β]] can be partitioned into triplets. More specifically, we will show below that
(ii) there are exactly 3p such points q 6= [1, 1, 1]. Hence, these points can be partitioned into exactly
p distinct triplets; let T` be the set of such triplets.
Take any two lines `1 , `01 6= [[1, 1, 1]], and suppose that |T`1 ∩ T`01 | > 3. We claim that `1 and `01 are
rotations of each other. Suppose otherwise for sake of contradiction. Let `2 , `3 be the rotations of `1 ,
and let `02 , `03 be the rotations of `01 . We are given that T`1 and T`01 share more than three triplets;
22 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

that is, `1 ∪ `2 ∪ `3 intersects `01 ∪ `02 ∪ `03 in more than 9 points. Because `1 and `01 are not rotations
of each other, each `i is distinct from all the `0j . Hence, `i ∩ `0j contains exactly one point for each i
and j. It follows that `1 ∪ `2 ∪ `3 and `01 ∪ `02 ∪ `03 consists of at most 3 · 3 = 9 points, a contradiction.
Hence, our assumption as wrong, and |T`1 ∩ T`01 | > 3 only if `1 and `01 are rotations of each other.
Just as there are p(p + 1) points in P − {[1, 1, 1]}, there are p(p + 1) lines in P ∗ − {[[1, 1, 1]]}. We can
partition these into p(p + 1)/3 triples (`1 , `2 , `3 ), where the lines in each triple are rotations of each
other. Now, pick one line ` from each triple and take the corresponding set T` of triplets. From the
previous paragraph, any two of these p(p + 1)/3 sets intersect in at most 3 triplets.
Hence, we have found a set S of p(p + 1)/3 elements (namely, the triplets of P), along with p(p + 1)/3
subsets of S (namely, the appropriate T` ) such that no two of these subsets have four elements in
common. This completes the proof.
Well, not quite. We have yet to prove that (i) if q 6= [1, 1, 1], then the triplet {q, ϕ(q), ϕ2 (q)} contains
three distinct points, and (ii) if `1 = [[α, β, γ]] 6= [[1, 1, 1]], then there are 3p points q 6= [1, 1, 1] on
[[α, β, γ]] ∪ [[β, γ, α]] ∪ [[γ, α, β]].
To prove (i), we first show that x3 ≡ 1 (mod p) only if x ≡ 1 (mod p). Because 3 is coprime to p − 1,
we can write 1 = 3r + (p − 1)s. We are given that x3 ≡ 1 (mod p), and by Fermat’s Little Theorem
we also have xp−1 ≡ 1 (mod p). Hence,
¡ ¢r ¡ p−1 ¢s
x = x3r+(p−1)s = x3 x ≡ 1r · 1s ≡ 1 (mod p).
(Alternatively, let g be a primitive element modulo p, and write x = g m for some nonnegative integer
m. Then
1 ≡ (g m )3 = g 3m (mod p),
implying that p − 1 divides 3m. Because p − 1 is relatively prime to 3, we must have (p − 1) | m.
Writing m = (p − 1)n, we have x ≡ g m ≡ (g p−1 )n ≡ 1 (mod p).)
Now, if q = [a, b, c] 6= [1, 1, 1], then suppose (for sake of contradiction) that [a, b, c] = [b, c, a]. There
exists κ such that (a, b, c) = (bκ, cκ, aκ). Thus,
ab−1 ≡ bc−1 ≡ ca−1 (mod p),
because all three quantities are congruent to κ modulo p. Hence, (ab−1 )3 ≡ (ab−1 )(bc−1 )(ca−1 ) ≡
1 (mod p). From this and the result in the last paragraph, we conclude that ab−1 ≡ 1 (mod p). There-
fore, a ≡ b (mod p), and similarly b ≡ c (mod p) — implying that [a, b, c] = [1, 1, 1], a contradiction.
Next, we prove (ii). Let `1 = [[α, β, γ]] 6= [[1, 1, 1]], `2 = [[β, γ, α]], and `3 = [[γ, α, β]]. Because
[[α, β, γ]] 6= [[1, 1, 1]], we know (from a proof similar to that in the previous paragraph) that `1 , `2 , `3
are pairwise distinct. Hence, any two of these lines intersect at exactly one point. We consider two
cases: `1 and `2 intersect at [1, 1, 1], or they intersect elsewhere.
If [1, 1, 1] lies on `1 and `2 , then it lies on `3 as well. Each line contains p + 1 points in total and
hence p points distinct from [1, 1, 1]. Counting over all three lines, we find 3p points distinct from
[1, 1, 1]; these points must be distinct from each other, because any two of the lines `i , `j intersect at
only [1, 1, 1].
If instead q0 = `1 ∩ `2 is not equal to [1, 1, 1], then [1, 1, 1] cannot lie on any of the lines `1 , `2 , `3 .
We have ϕ(q0 ) = `2 ∩ `3 and ϕ2 (q0 ) = `3 ∩ `1 ; because q0 6= [1, 1, 1], the three intersection points
q0 , ϕ(q0 ), ϕ2 (q0 ) are pairwise distinct. Now, each of the three lines `1 , `2 , `3 contains p + 1 points (all
distinct from [1, 1, 1]), for a total of 3p + 3 points. However, we count each of q0 , ϕ(q0 ), ϕ2 (q0 ) twice
in this manner, so in fact we have (3p + 3) − 3 = 3p points on `1 ∪ `2 ∪ `3 − {[1, 1, 1]}, as desired.
This completes the proof.
Mathematics Olympiad Coachs Seminar, Zhuhai, China 1

03/22/2004

Combinatorics
1. An n-string is a string of digits formed by writing the numbers 1, 2, . . . , n in some order (in base 10).
For example, one possible 10-string is
35728910461.
What is the smallest n greater than 1 such that there exists a palindromic n-string?

2. We have a polyhedron such that an ant can walk from one vertex to another, traveling only along
edges, and traveling every edge exactly once. What is the smallest possible total number of vertices,
edges, and faces of this polyhedron?

3. The member of a distinguished committee were choosing a president, and each member gave one
vote to one of the 27 candidate. For each candidate, the exact percentage of votes the candidate got
was smaller by at least 1 than the number of votes for that candidate. What is the smallest possible
number of member of the committee?

4. A class room of a 5 × 5 array of desks, to be filled by anywhere from 0 to 25 students, inclusive. No


student will sit at a desk unless either all other desks in its row or all others in its column are filled
(or both). Considering only the set of desks that are occupied (and which student sits at each desk),
how many possible arrangements are there?

5. There are 51 senators in a senate. The senate needs to be divided into n committees so that each
senator is on one committee. Each senator hates exactly three other senators. (If senator A hates
senator B, then senator B does not necessarily hate senator A.) Find the smallest n such that it is
always possible to arrange the committees so that no senator hates another senator on his or her
committee.

Solution: Assume that there are 7 senators A1 , . . . , A7 such that each Ai hates Ai+1 , Ai+2 , and
Ai+3 (where indices are taken modulo 7). In this situation, for any different Ai , Aj , either Ai hates
Aj or vice versa. The senators A1 , . . . , A7 must be placed on a different committee. Thus, n ≥ 7.
In order to show that n ≤ 7, we will prove the following stronger statement by induction on k ≥ 1:
for k senators, each of whom hates at most 3 others, it is possible to arrange the senators into 7
committees so that no senator hates another senator on his or her committee.
For the base case k = 1, note that we can have 7 committees, 6 of which are empty and 1 of which
contains the sole senator.
Now assume the claim is true for all k ≤ m−1. Suppose we are given m senators, each of whom hates
at most 3 others. If each of those m senators is hated by more than 3 others, then the total number
of acts of hating must be greater than 3m, but this is not possible since each senator hates at most
3 others. Therefore, there must be at least one senator A who is hated by at most 3 others. By the
induction hypothesis, we can split the m − 1 other senators into 7 committees satisfying the property
that no senator hates another senator on the same committee. By the Pigeonhole Principle, one
of those committees contains neither a person whom A hates nor a person who hates A. We can
therefore place A in that committee. The induction is complete.

6. Given that 22004 is a 604-digit number with leafing digit 1. Determine the number of elements in the
set {20 , 21 , 22 , . . . , 22003 } with leading digit 4.
2 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

7. Let S be a set with 2002 elements, and let N be an integer with 0 ≤ N ≤ 22002 . Prove that it is
possible to color every subset of S either blue or red so that the following conditions hold:

(a) the union of any two red subsets is red;


(b) the union of any two blue subsets is blue;
(c) there are exactly N red subsets.

First Solution: We prove that this can be done for any n-element set, where n is an positive
integer, Sn = {1, 2, . . . , n} and for any positive integer N with 0 ≤ N ≤ 2n .
We induct on n. The base case n = 1 is trivial. Assume that we can color the subsets of Sn =
{1, 2, . . . , n} in the desired manner, for any integer Nn with 0 ≤ Nn ≤ 2n . We show that there is
a desired coloring for Sn+1 = {1, 2, . . . , n, n + 1} and any integer Nn+1 with 0 ≤ Nn+1 ≤ 2n+1 . We
consider the following cases.

(i) 0 ≤ Nn+1 ≤ 2n . Applying the induction hypothesis to Sn and Nn = Nn+1 ,we get a coloring of
all subsets of Sn satisfying conditions (a), (b), (c). All uncolored subsets of Sn+1 contain the
element n + 1; we color all of them blue. It is not hard to see that this coloring of all the subsets
of Sn+1 satisfies conditions (a), (b), (c).
(ii) 2n + 1 ≤ Nn+1 ≤ 2n+1 . By case (i), we know that there exists a coloring of the subsets of Sn+1
satisfying (a) and (b) and having 2n+1 − Nn+1 red subsets. Then, we switch the color of each
subset: if it is blue now, we recolor it red; if it is red now, we recolor it blue. It is not hard to
see that this coloring of all the subsets of Sn+1 satisfies conditions (a), (b), (c).

Thus our induction is complete.

Second Solution: If N = 0, we color every subset blue; if N = 22002 , we color every subset
red. Now suppose neither of these holds. We may assume that S = {0, 1, 2, . . . , 2001}. Write N in
binary representation:
N = 2a1 + 2a2 + · · · + 2ak ,
where the ai are all distinct; then each ai is an element of S. Color each ai red, and color all the
other elements of S blue. Now declare each nonempty subset of S to be the color of its largest
element, and color the empty subset blue. If T, U are any two nonempty subsets of S, then the
largest element of T ∪ U equals the largest element of T or the largest element of U , and if T is
empty, then T ∪ U = U . It readily follows that (a) and (b) are satisfied. To verify (c), notice that, for
each i, there are 2ai subsets of S whose largest element is ai (obtained by taking ai in combination
with any of the elements 0, 1, . . . , ai − 1). If we sum over all i, each red subset is counted exactly
once, and we get 2a1 + 2a2 + · · · + 2ak = N red subsets.

8. An n-term sequence (x1 , x2 , . . . , xn ) in which each term is either 0 or 1 is called a binary sequence of
length n. Let an be the number of binary sequences of length n containing no three consecutive terms
equal to 0, 1, 0 in that order. Let bn be the number of binary sequences of length n that contain no
four consecutive terms equal to 0, 0, 1, 1 or 1, 1, 0, 0 in that order. Prove that bn+1 = 2an for all
positive integers n.

Solution: We refer to the binary sequences counted by (an ) and (bn ) as “type A” and “type
B”, respectively. For each binary sequence (x1 , x2 , . . . , xn ) there is a corresponding binary sequence
Mathematics Olympiad Coachs Seminar, Zhuhai, China 3

(y0 , y1 , . . . , yn ) obtained by setting y0 = 0 and

yi = x1 + x2 + · · · + xi mod 2, i = 1, 2, . . . , n. (∗)

(Addition mod 2 is defined as follows: 0 + 0 = 1 + 1 = 0 and 0 + 1 = 1 + 0 = 1.) Then

xi = yi + yi−1 mod 2, i = 1, 2, . . . , n,

and it is easily seen that (∗) provides a one-to-one correspondence between the set of all binary
sequences of length n and the set of binary sequences of length n + 1 in which the first term is 0.
Moreover, the binary sequence (x1 , x2 , . . . , xn ) has three consecutive terms equal to 0, 1, 0 in that
order if and only if the corresponding sequence (y0 , y1 , . . . , yn ) has four consecutive terms equal to 0,
0, 1, 1 or 1, 1, 0, 0 in that order, so the first is of type A if and only if the second is of type B. The
set of type B sequences of length n + 1 in which the first term is 0 is exactly half the total number
of such sequences, as can be seen by means of the mapping in which 0’s and 1’s are interchanged.

9. Some checkers placed on an n × n checkerboard satisfy the following conditions:

(a) every square that does not contain a checker shares a side with one that does;
(b) given any pair of squares that contain checkers, there is a sequence of squares containing checkers,
starting and ending with the given squares, such that every two consecutive squares of the
sequence share a side.

Prove that at least (n2 − 2)/3 checkers have been placed on the board.

Solution: It suffices to show that if m checkers are placed so as to satisfy condition (b), then
the number of squares they either cover or are adjacent to is at most 3m + 2. But this is easily seen
by induction: it is obvious for m = 1, and if m checkers are so placed, some checker can be removed
so that the remaining checkers still satisfy (b); they cover at most 3m − 1 squares, and the new
checker allows us to count at most 3 new squares (since the square it occupies was already counted,
and one of its neighbors is occupied).

Note. The exact number of checkers required is known for m × n checkerboards with m small, but
only partial results are known in the general case. Contact the authors for more information.

10. Find the smallest positive integer n such that if n unit squares of a 1000 × 1000 unit-square board
are colored, then there will exist three colored unit squares whose centers form a right triangle with
legs parallel to the edges of the board.

First Solution: We show that n = 1999. Indeed, n ≥ 1999 because we can color 1998 squares
without producing a right triangle: color every square in the first row and the first column, except
for the one square at their intersection.
Now assume that some squares have been colored so that no desired right triangle is formed. Call a
row or column heavy if it contains more than one colored square, and light otherwise. Our assumption
then states that no heavy row and heavy column intersect in a colored square.
If there are no heavy rows, then each row contains at most one colored square, so there are at most
1000 colored squares. We reach the same conclusion, if there are no heavy columns. If there is a
heavy row and a heavy column, then by the initial observation, each colored square in the heavy row
4 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

or column must lie in a light column or row, and no two can lie in the same light column or row.
Thus the number of colored squares is at most the number of light rows and columns, which is at
most 2 × (1000 − 1) = 1998.
We conclude that in fact 1999 colored squares is the minimum needed to force the existence of a right
triangle of the type described.

Second Solution: Assume that 1999 squares are colored and the required right triangle does
not exist. By the Pigeonhole Principle, there is a row with a1 ≥ 2 colored squares. Interchange rows
to make this the first row. Interchange columns so that the first a1 squares in the first row are all
colored. Then the first a1 columns have no colored squares other than the ones in the first row, for
otherwise we would have a right triangle.
Observe that a1 cannot equal 1000, for then we would have no place for the remaining 999 colored
squares. Also, a1 cannot equal 999, for then the remaining 1000 colored squares must all be in the
last column and we would have a right triangle, a contradiction. Hence 1000 − a1 ≥ 2.
Throw away for now the first a1 columns and the first row and consider the remaining (1000−a1 )×999
rectangular grid G2 . It contains 1999 − a1 ≥ 999 + 2 = 1001 colored squares. Therefore, there is a
row in G2 with at least a2 ≥ 2 colored squares. Interchange rows and then columns so that the first
a2 squares of the first row are colored. Then the first a2 columns have no colored squares other than
the ones in the first row.
Observe that a1 + a2 cannot equal to 1000, for then we would have no place to put the remaining 999
colored squares. Also, a1 + a2 cannot equal 999, for then the remaining 1000 colored squares must all
be in the last column and we would have a right triangle, a contradiction. Hence 1000− (a1 + a2 ) ≥ 2.
The above process can be continued, but 1000 − (a1 + a2 + · · · ) ≥ 2 contradicts the fact that
a1 , a2 , · · · ≥ 2. Thus, with 1999 colored squares there must be a right triangle. As in the first
solution, we can find a way to arrange 1998 colored squares without obtaining a right triangle of the
type described.

Third Solution: We prove a more general statement:


Lemma Let nk,` be the smallest positive integer such that if nk,` squares of a k ×` (k, ` ≥
2) board are colored, then there necessarily exist a right triangle of the type described.
Define t = tk,` = k + ` to be the total dimension of the board. Then nk,` = t − 1.
Proof: As in the first solution, we can color t − 2 squares without producing a right triangle: fill
every square in the first row and the first column, except for the one square at their intersection.
Hence nk,` ≥ t − 1.
Now we prove by induction on t that nk,` = t − 1.
For the base case t = 4, we have k = ` = 2 and it is easy to see that n2,2 = 3.
Assume that the claim is true for t = m, m ≥ 4. For t = m + 1, we claim that nk,` = m when
k + ` = m + 1, k, ` ≥ 2. For the sake of contradiction, suppose that there is a k × ` board with m
colored squares and no right triangles. Without loss of generality, suppose that k ≥ `. Then k > 3.
There is a row with at most 1 colored square because otherwise we will have at least 2k ≥ t > m
colored squares. Cross out that row to obtain a (k − 1) × ` board with t = m, and k − 1, ` ≥ 2, and
at least ≥ m − 1 colored squares. By the induction hypothesis, there is right triangle, contradicting
our assumption. Therefore our assumption is wrong and we conclude that nk,` = m = t − 1. Our
induction is complete, and this finishes our proof.
Mathematics Olympiad Coachs Seminar, Zhuhai, China 5

11. Every unit square of a 2004 × 2004 grid is to be filled with one of the letters A, B, C, D, so that every
2 × 2 subsquare contains exactly one of each letter. In how many ways can this be done?

12. Let n 6= 0. For every sequence of integers

a = a 0 , a1 , a2 , . . . , a n

satisfying 0 ≤ ai ≤ i, for i = 0, . . . , n, define another sequence

t(a) = t(a)0 , t(a)1 , t(a)2 , . . . , t(a)n

by setting t(a)i to be the number of terms in the sequence a that precede the term ai and are
different from ai . Show that, starting from any sequence a as above, fewer than n applications of the
transformation t lead to a sequence b such that t(b) = b.

First Solution: Note first that the transformed sequence t(a) also satisfies the inequalities
0 ≤ t(a)i ≤ i, for i = 0, . . . , n. Call any integer sequence that satisfies these inequalities an in-
dex bounded sequence.
We prove now that that ai ≤ t(a)i , for i = 0, . . . , n. Indeed, this is clear if ai = 0. Otherwise, let
x = ai > 0 and y = t(a)i . None of the first x consecutive terms a0 , a1 , . . . , ax−1 is greater than
x − 1, so they are all different from x and precede x (see the diagram below). Thus y ≥ x, that is,
ai ≤ t(a)i , for i = 0, . . . , n.

0 1 ... x−1 ... i


a a0 a1 ... ax−1 ... x
t(a) t(a)0 t(a)1 ... t(a)x−1 ... y

This already shows that the sequences stabilize after finitely many applications of the transformation
t, because the value of the index i term in index bounded sequences cannot exceed i. Next we prove
that if ai = t(a)i , for some i = 0, . . . , n, then no further applications of t will ever change the index i
term. We consider two cases.

• In this case, we assume that ai = t(a)i = 0. This means that no term on the left of ai is
different from 0, that is, they are all 0. Therefore the first i terms in t(a) will also be 0 and this
repeats (see the diagram below).

0 1 ... i
a 0 0 ... 0
t(a) 0 0 ... 0

• In this case, we assume that ai = t(a)i = x > 0. The first x terms are all different from
x. Because t(a)i = x, the terms ax , ax+1 , . . . , ai−1 must then all be equal to x. Consequently,
t(a)j = x for j = x, . . . , i − 1 and further applications of t cannot change the index i term (see
the diagram below).

0 1 ... x−1 x x+1 ... i


a a0 a1 ... ax−1 x x ... x
t(a) t(a)0 t(a)1 ... t(a)x−1 x x ... x
6 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

For 0 ≤ i ≤ n, the index i entry satisfies the following properties: (i) it takes integer values; (ii) it is
bounded above by i; (iii) its value does not decrease under transformation t; and (iv) once it stabilizes
under transformation t, it never changes again. This shows that no more than n applications of t
lead to a sequence that is stable under the transformation t.
Finally, we need to show that no more than n−1 applications of t is needed to obtain a fixed sequence
from an initial n + 1-term index bounded sequence a = (a0 , a1 , . . . , an ). We induct on n.
For n = 1, the two possible index bounded sequences (a0 , a1 ) = (0, 0) and (a0 , a1 ) = (0, 1) are already
fixed by t so we need zero applications of t.
Assume that any index bounded sequence (a0 , a1 , . . . , an ) reach a fixed sequence after no more than
n−1 applications of t. Consider an index bounded sequence a = (a0 , a1 , . . . , an+1 ). It suffices to show
that a will be stabilized in no more than n applications of t. We approach indirectly by assuming on
the contrary that n + 1 applications of transformations are needed. This can happen only if an+1 = 0
and each application of t increased the index n + 1 term by exactly 1. Under transformation t,
the resulting value of index i term will not be effected by index j term for i < j. Hence by the
induction hypothesis, the subsequence a0 = (a0 , a1 , . . . , an ) will be stabilized in no more than n − 1
applications of t. Because index n term is stabilized at value x ≤ n after no more than min{x, n − 1}
applications of t and index n + 1 term obtains value x after exactly x applications of t under our
current assumptions. We conclude that the index n + 1 term would become equal to the index n
term after no more than n − 1 applications of t. However, once two consecutive terms in a sequence
are equal they stay equal and stabilize together. Because the index n term needs no more than n − 1
transformations to be stabilized, a can be stabilized in no more than n − 1 applications of t, which
contradicts our assumption of n + 1 applications needed. Thus our assumption was wrong and we
need at most n applications of transformation t to stabilize an (n + 1)-term index bounded sequence.
This completes our inductive proof.

Note: There are two notable variations proving the last step.

• First variation The key case to rule out is ti (a)n = i for i = 0, . . . , n. If an = 0 and t(a)n = 1,
then a has only one nonzero term. If it is a1 , then t(a) = 0, 1, 1, . . . , 1 and t(t(a)) = t(a), so
t(t(a))n 6= 2; if it is ai for i > 1, then t(a) = 0, . . . , 0, i, 1, . . . , 1 and t(t(a)) = 0, . . . , 0, i, i +
1, . . . , i + 1 and t(t(a))n 6= 2. That’s a contradiction either way. (Actually we didn’t need to
check the first case separately except for n = 2; if an = an−1 = 0, they stay together and so get
fixed at the same step.)
• Second variation Let bn−1 be the terminal value of an−1 . Then an−1 gets there at least as soon
as an does (since an only rises one each time, whereas an−1 rises by at least one until reaching
bn−1 and then stops, and furthermore an−1 ≥ 0 = an to begin with), and when an does reach
that point, it is equal to an−1 . (Kiran Kedlaya, one of the graders of this problem, likes to call
this a “tortoise and hare” argument–the hare an−1 gets a head start but gets lazy and stops, so
the tortoise an will catch him eventually.)

Second Solution: We prove that for n ≥ 2, the claim holds without the initial condition 0 ≤ ai ≤ i.
(Of course this does not prove anything stronger, but it’s convenient.) We do this by induction on
n, the case n = 2 being easy to check by hand as in the first solution.
Note that if c = (c0 , . . . , cn ) is a sequence in the image of t, and d is the sequence (c1 , . . . , cn ), then
the following two statements are true:
Mathematics Olympiad Coachs Seminar, Zhuhai, China 7

(a) If e is the sequence obtained from d by subtracting 1 from each nonzero term, then t(d) = t(e).
(If there are no zero terms in d, then subtracting 1 clearly has no effect. If there is a zero term
in d, it must occur at the beginning, and then every nonzero term is at least 2.)
(b) One can compute t(c) by applying t to the sequence c1 , . . . , cn , adding 1 to each nonzero term,
and putting a zero in front.

The recipe of (b) works for computing ti (c) for any i, by (a) and induction on i.
We now apply the induction hypothesis to t(a)1 , . . . , t(a)n to see that it stabilizes after n − 2 more
applications of t; by the recipe above, that means a stabilizes after n − 1 applications of t.

Note: A variation of the above approach is the following. Instead of pulling off one zero, pull
off all initial zeroes of a0 , . . . , an . (Or rather, pull off all terms equal to the initial term, whatever it
is.) Say there are k + 1 of them (clearly k ≤ n); after min{k, 2} applications of t, there will be k + 1
initial zeroes and all remaining terms are at least k. So now max{1, n − k − 2} applications of t will
straighten out the end, for a total of min{k, 2} + max{1, n − k − 2}. A little case analysis shows that
this is good enough: if k + 1 ≤ n − 1, then this sum is at most n − 1 except maybe if 3 > n − 1, i.e.,
n ≤ 3, which can be checked by hand. If k + 1 > n − 1 and we assume n ≥ 4, then k ≥ n − 1 ≥ 3, so
the sum is 2 + max{1, n − k − 2} ≤ max{3, n − k} ≤ n − 1.

13. For any nonempty set S of real numbers, let σ(S) denote the sum of the elements of S. Given a
set A of n positive integers, consider the collection of all distinct sums σ(S) as S ranges over the
nonempty subsets of A. Prove that this collection of sums can be partitioned into n classes so that
in each class, the ratio of the largest sum to the smallest sum does not exceed 2.

Solution: Let A = {a1 , a2 , . . . , an } where a1 < a2 < · · · < an . For i = 1, 2, . . . , n let si =


a1 + a2 + · · · + ai and take s0 = 0. All the sums in question are less than or equal to sn , and if σ is
one of them, we have
si−1 < σ ≤ si (∗)
for an appropriate i. Divide the sums into n classes by letting Ci denote the class of sums satisfying
(∗). We claim that these classes have the desired property. To establish this, it suffices to show that
(∗) implies
1
si < σ ≤ si . (∗∗)
2
Suppose (∗) holds. The inequality a1 + a2 + · · · + ai−1 = si−1 < σ shows that the sum σ contains at
least one addend ak with k ≥ i. Then since then ak ≥ ai , we have

si − σ < si − si−1 = ai ≤ ak ≤ σ,

which together with σ ≤ si implies (∗∗).

Note: The result does not hold if 2 is replaced by any smaller constant c. To see this, choose
n such that c < 2 − 2−(n−1) and consider the set {1, . . . , 2n−1 }. If this set is divided into n
subsets, two of 1, . . . , 2n−1 , 1 + · · · + 2n−1 must lie in the same subset, and their ratio is at least
(1 + · · · + 2n−1 )/(2n−1 ) = 2 − 2−(n−1) > c.

14. Let a set of 2004 points in the plane be given, no three of which are collinear. Let S denote the set
of all lines determined by pairs of points from the set. Show that it is possible to color the points of
8 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

S with at most two colors, such that any points P and Q in the set, the number of lines in S which
separates P and Q is odd if and only if P and Q have the same color.
A line ` separates two points P and Q if P and Q lie on opposite sides of ` with neither point on `.
15. I have an n × n sheet of stamps, from which I’ve been asked to tear out blocks of three adjacent
stamps in a single row or column. (I can only tear along the perforations separating adjacent stamps,
and each block must come out of a sheet in one piece.) Let b(n) be the smallest number of blocks I
can tear out and make it impossible to tear out any more blocks. Prove that there are constants c
and d such that
1 2 1
n − cn ≤ b(n) ≤ n2 + dn
7 5
for all n > 0.

Solution: The upper bound requires an example of a set of 51 n2 + dn blocks whose removal
makes it impossible to remove any further blocks. We note first that we can tile the plane, using tiles
that contain one block for every five stamps, so that no more blocks can be chosen. Two such tilings
are shown below with one tile outlined in heavy lines. Assume that there are x unit squares in each
tile. Then there are 15 x blocks in each tile. Choose a constant m such that the basic tile fits inside
an (m + 1) × (m + 1) square. Given an n × n section of the tiling, take all tiles lying entirely within
that section and add as many additional tiles, which lie partially in and partially out of that section,
as possible. Let k denote the total number of chosen tiles. Hence there are 15 kx blocks contained in
the k chosen tiles. The n × n section is covered by all the chosen tiles, and these are all contained in
a concentric (n + 2m) × (n + 2m) square. Then kx ≤ (n + 2m)2 , and so there are at most
1 1 1 4m2 + 4m
kx ≤ (n + 2m)2 ≤ n2 + n
5 5 5 5
blocks total. We can classify all the above blocks into three categories (i) blocks lying completely in
the n × n section; (ii) blocks lying partially in the section; (iii) blocks lying completely outside of the
section. Suppose there are x1 , x2 , x3 blocks in categories (i), (ii), (iii), respectively. We do not have
to worry about blocks in category (iii), and we take all the blocks in category (i). We need to deal
with blocks in category (ii) with more care. By the conditions of the problem, we can not take out
those blocks from the n × n section. All the blocks in category (ii) are on the border of the section.
Hence there are at most 4n blocks in category (ii), and so these blocks contain at most 8n stamps in
the n × n square. We might need additional blocks to deal with these stamps. Each of the additional
blocks must contain one of these stamps. Thus there are at most 8n additional blocks. Thus there
are at most
1 4m2 + 4m + 40
x1 + 8n ≤ x1 + x2 + x3 + 8n ≤ n2 + n
5 5
blocks needed.
In fact, we’ll prove the lower bound
1
b(n) ≥ (n2 − 2n).
6
Each block can be classified as “horizontal” or “vertical” in the obvious fashion. Given an arrangement
of blocks, let H and V be the numbers of horizontal and vertical blocks. respectively. Without loss
of generality, we may assume V ≤ H.
We associate each unused stamp which is not in one of the two leftmost columns to the first block
one encounters proceeding leftward from the stamp. Note that one never has to proceed leftward
more than two stamps; otherwise, there would be another block to remove.
Mathematics Olympiad Coachs Seminar, Zhuhai, China 9

h-block s s

Each block is associated to at most two stamps in each row that it occupies. In particular, each
horizontal block is associated to at most two stamps. Moreover, a vertical block cannot have an
unused stamp on its immediate right in each of the three rows it covers; otherwise, those three
stamps would form a block. Thus a vertical block is associated to at most four stamps.

v- v-
b b s s
l s s l
o o
c s s c s s
k k

Thus, if we count stamps block by block (plus the extra stamps in the two leftmost columns), the
total number is

n2 ≤ 2n + 3H + 3V + 2H + 4V = 2n + 5H + 7V
≤ 2n + 6H + 6V,

giving the desired bound.

Note: This problem was inspired by a paper of Manjul Bhargava (Mistilings of the plane with
rectangles, to appear), in which the improved lower bound
4 2
b(n) ≥ n − cn
21
is obtained by a rather complicated argument. It is believed that in fact b(n) ≥ 15 n2 − cn, but the
fact that there are essentially two different equality cases makes this extremely difficult to prove.
The aforementioned paper also treats rectangles of other sizes for which there is only one optimal
arrangement; in those cases one can achieve upper and lower bounds with the same quadratic con-
stant.

16. A computer screen shows a 98×98 chessboard, colored in the usual way. One can select with a mouse
any rectangle with sides on the lines of the chessboard and click the mouse button: as a result, the
colors in the selected rectangle switch (black becomes white, white becomes black). Find, with proof,
the minimum number of mouse clicks needed to make the chessboard all one color.

Solution: More generally, we show that the minimum number of selections required for an n × n
chessboard is n − 1 if n is odd, and n if n is even. Consider the 4(n − 1) squares along the perimeter
of the chessboard, and at each step, let us count the number of pairs of adjacent perimeter squares
which differ in color. This total begins at 4(n − 1), ends up at 0, and can decrease by no more than
4 each turn (If the rectangle touches two adjacent edges of the board, then only two pairs can be
affected. Otherwise, the rectangle either touches no edges, one edge, or two opposite edges, in which
case 0, 2 or 4 pairs change, respectively). Hence at least n − 1 selections are always necessary.
If n is odd, then indeed n − 1 selections suffice, by choosing every second, fourth, sixth, etc. row and
column. However, if n is even, then n − 1 selections cannot suffice: at some point a corner square
10 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

must be included in a rectangle (since the corners do not all begin having the same color), and such
a rectangle can only decrease the above count by 2. Hence n selections are needed, and again by
selecting every other row and column, we see that n selections also suffice.

17. The Y2K Game is played on a 1 × 2000 grid as follows. Two players in turn write either an S or an
O in an empty square. The first player who produces three consecutive boxes that spell SOS wins.
If all boxes are filled without producing SOS then the game is a draw. Prove that the second player
has a winning strategy.

Solution: Call a partially filled board stable if there is no SOS and no single move can pro-
duce an SOS; otherwise call it unstable. For a stable board call an empty square bad if either an S
or an O played in that square produces an unstable board. Thus a player will lose if the only empty
squares available to him are bad, but otherwise he can at least be guaranteed another turn with a
correct play.
Claim: A square is bad if and only if it is in a block of 4 consecutive squares of the form S – – S.
Proof: If a square is bad, then an O played there must give an unstable board. Thus the bad square
must have an S on one side and an empty square on the other side. An S played there must also give
an unstable board, so there must be another S on the other side of the empty square. 2
From the claim it follows that there are always an even number of bad squares. Thus the second
player has the following winning strategy:

(a) If the board is unstable at any time, play the winning move, otherwise continue as below.
(b) On the first move, play an S at least four squares away from either end and from the first player’s
first move. (The board is long enough that this is possible.)
(c) On the second move, play an S three squares away from the second player’s first move, so that
the squares in between are empty. (Regardless of the first player’s second move, this must be
possible on at least one side.) This produces two bad squares; whoever plays in one of them
first will lose. Thus the game will not be a draw.
(d) On any subsequent move, play in a square which is not bad. Such a square will always exist
because if the board is stable, there will be an odd number of empty squares and an even number
of bad squares.

Since there exist bad squares after the second player’s second move, the game cannot end in a draw,
and since the second player can always leave the board stable, the first player cannot win. Therefore
eventually the second player will win.

18. A game of solitaire is played with R red cards, W white cards, and B blue cards. A player plays all
the cards one at a time. With each play he accumulates a penalty. If he plays a blue card, then he
is charged a penalty which is the number of white cards still in his hand. If he plays a white card,
then he is charged a penalty which is twice the number of red cards still in his hand. If he plays a
red card, then he is charged a penalty which is three times the number of blue cards still in his hand.
Find, as a function of R, W, and B, the minimal total penalty a player can amass and all the ways
in which this minimum can be achieved.

Solution: Let the integers at any time be a1 , a2 , . . . , an , and let ` be the index
P of the integer
chosen as large in the previous step. Define the score of the position to be S = i6=` ai . On any
step we will choose a new large integer a` , (which currently contributes to S but will not after the
Mathematics Olympiad Coachs Seminar, Zhuhai, China 11

move,) and we will replace a` (which currently does not contribute to S) by something smaller than
a` , (which will contribute to new S). Thus S is decreased by at least one on every move. Since S
starts with a finite values and S ≥ 0, play must stop in a finite amount of moves.

19. A game of solitaire is played with R red cards, W white cards, and B blue cards. A player plays all
the cards one at a time. With each play he accumulates a penalty. If he plays a blue card, then he
is charged a penalty which is the number of white cards still in his hand. If he plays a white card,
then he is charged a penalty which is twice the number of red cards still in his hand. If he plays a
red card, then he is charged a penalty which is three times the number of blue cards still in his hand.
Find, as a function of R, W, and B, the minimal total penalty a player can amass and all the ways
in which this minimum can be achieved.

Solution: The minimum achievable penalty is

min{BW, 2W R, 3RB}.

The three penalties BW, 2W R, and 3RB can clearly be obtained by playing cards in one of the three
orders

• bb · · · brr · · · rww · · · w,
• rr · · · rww · · · wbb · · · b,
• ww · · · wbb · · · brr · · · r.

Given an order of play, let a “run” of some color denote a set of cards of that color played consecutively
in a row. Then the optimality of one of the three above orders follows immediately from the following
lemma, along with the analogous observations for blue and white cards.

Lemma 1 For any given order of play, we may combine any two runs of red cards without
increasing the penalty.

Proof: Suppose that there are w white cards and b blue cards between the two red runs. Moving a
red card from the first run to the second costs us 2w because we now have one more red card after
the w white cards. However, we gain 3b because this red card is now after the b blues. If the net gain
3b − 2w is non-negative, then we can move all the red cards in the first run to the second run without
increasing the penalty. If the net gain 3b − 2w is negative, then we can move all the red cards in the
second run to the first run without increasing the penalty, as desired.
Thus there must be an optimal game where cards are played in one of the three given orders. To
determine whether there are other optimal orders, first observe that wr can never appear during
an optimal game; otherwise, playing these two cards in the order rw instead decreases the penalty.
Similarly, bw and rb can never appear. Now we prove the following lemma.

Lemma 2 Any optimal order of play must have less than 5 runs.

Proof: Suppose that some optimal order of play had at least five runs. Assume the first card played
is red; the proof is similar in the other cases. Say we first play r1 , w1 , b1 , r2 , w2 cards of each color,
where each ri , wi , bi is positive and where we cycle through red, white, and blue runs. From the proof
of our first lemma we must have both 3b1 − 2w1 = 0 and b1 − 2r2 = 0. Hence the game starting with
playing r1 , w1 + w2 , b1 , r2 , 0 cards is optimal as well, so we must also have 3b1 − 2(w1 + w2 ) = 0, a
contradiction.
12 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Thus, any optimal game has at most 4 runs. Now from lemma 1 and our initial observations, any
order of play of the form
rr · · · rww · · · wbb · · · brr · · · r,
is optimal if and only if 2W = 3B and 2W R = 3RB ≤ W B; and similar conditions hold for 4-run
games that start with w or b.

20. Each of eight boxes contains six balls. Each ball has been colored with one of n colors, such that
no two balls in the same box are the same color, and no two colors occur together in more than one
box. Determine, with justification, the smallest integer n for which this is possible.

First Solution: The smallest such n is 23.


We first show that n = 22 cannot be achieved.
Assume that some color, say red, occurs four times. Then the first box containing red contains 6
colors, the second contains red and 5 colors not mentioned so far, and likewise for the third and
fourth boxes. A fifth box can contain at most one color used in each of these four, so must contain
2 colors not mentioned so far, and a sixth box must contain 1 color not mentioned so far, for a total
of 6+5+5+5+2+1=24, a contradiction.
Next, assume that no color occurs four times; this forces at least four colors to occur three times. In
particular, there are two colors that occur at least three times and which both occur in a single box,
say red and blue. Now the box containing red and blue contains 6 colors, the other boxes containing
red each contain 5 colors not mentioned so far, and the other boxes containing blue each contain 3
colors not mentioned so far (each may contain one color used in each of the boxes containing red but
not blue). A sixth box must contain one color not mentioned so far, for a total of 6+5+5+3+3+1=23,
again a contradiction.
We now give a construction for n = 23. We still cannot have a color occur four times, so at least
two colors must occur three times. Call these red and green. Put one red in each of three boxes,
and fill these with 15 other colors. Put one green in each of three boxes, and fill each of these boxes
with one color from each of the three boxes containing red and two new colors. We now have used
1 + 15 + 1 + 6 = 23 colors, and each box contains two colors that have only been used once so far.
Split those colors between the last two boxes. The resulting arrangement is:

1 3 4 5 6 7
1 8 9 10 11 12
1 13 14 15 16 17
2 3 8 13 18 19
2 4 9 14 20 21
2 5 10 15 22 23
6 11 16 18 20 22
7 12 17 19 21 23

Note that the last 23 can be replaced by a 22.


Now we present a few more methods of proving n ≥ 23.

Second Solution: As in the first solution, if n = 22 is possible, it must be possible with no


color appearing four or more times. By the Inclusion-Exclusion Principle, the number of colors (call
Mathematics Olympiad Coachs Seminar, Zhuhai, China 13

it C) equals the number of balls (48), minus the number of pairs of balls of the same color (call it
P ), plus the number of triples of balls of the same color (call it T ); that is,

C = 48 − P + T.
¡¢
For every pair of boxes, at most one color occurs in both boxes, so P ≤ 82 = 28. Also, if n ≤ 22,
there must be at least 48 − 2(22) = 4 colors that occur three times. Then C ≥ 48 − 28 + 4 = 24, a
contradiction.

Third Solution: Assume n = 22 is possible. By the Pigeonhole Principle, some color oc-
curs three times; call it color 1. Then there are three boxes containing 1 and fifteen other colors, say
colors 2 through 16. The other five boxes each contain at most three colors in common with the first
three boxes, so they contain at least three colors from 17 through 22.
Since 5 × 3 > 2 × 6, one color from 17 to 22 occurs at least three times in the last five boxes; say it’s
color 17. Then two balls in each of those three boxes have colors among those labeled 18 through 22.
But then one of these colors must appear together with 17, a contradiction.

Fourth Solution: Label the colors 1, 2, . . . , n, and let a1 , a2 , . . . , an be the number of balls
of color 1, 2, . . . , n, respectively. Then
X n
ai = 48.
i=1
¡ai ¢ ¡8¢
Since 2 is the number of boxes sharing color i and there are 2 = 28 pairs of boxes, each of which
can only share at most one color,
µ ¶ Xn µ ¶ n
X
8 ai ai (ai − 1)
28 = ≥ =
2 2 2
i=1 i=1
n n n
1X 1X 1X 2
= a2i − ai = ai − 24,
2 2 2
i=1 i=1 i=1

n
X
or a2i ≤ 104. By the RMS-AM Inequality,
i=1

à n
!1 n
1X 2 2
1X
ai ≥ ai .
n n
i=1 i=1

It follows that
288
104n ≥ 482 or n ≥ > 22.
13

Note: For the general case of m + 2 boxes each containing m balls, this method leads to the
lower bound of
m2 (m + 2)
n≥ .
2m + 1
But for m = 8, this lower bound of n ≥ 640 17 = 37.647... is not good enough. The actual minimum
value of n is 39, as proved in the sixth solution.
14 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Fifth Solution: Let mi,j be the number of balls which are the same color as the j th ball in
box i (including that ball). For a fixed box i, 1 ≤ i ≤ 8, consider the sums

6
X 6
X 1
Si = mi,j and si = .
mi,j
j=1 j=1

For each fixed i, since no pair of colors is repeated, each of the remaining seven boxes can contribute
at most one ball to Si . Thus Si ≤ 13. It follows by the convexity of f (x) = 1/x (and consequently,
by the Jensen’s Inequality) that si is minimized when one of the mi,j is equal to 3 and the other
five equal 2. Hence si ≥ 17/6. Note that

8 X
X 6
1 17 68 2
n= ≥8· = = 22 .
mi,j 6 3 3
i=1 j=1

Hence there must be at least 23 colors.

Sixth Solution: Let xi be the number of colors that occur exactly i times. Then

x1 + x2 + x3 + · · · + xi + · · · = n (1)

and
x1 + 2x2 + 3x3 + · · · + ixi + · · · = 48. (2)
Now we count the number of pairs of like-colored balls. Each pair of boxes can contain at most one
pair of like-colored balls. Hence
µ ¶ µ ¶
3 i
x2 + x3 + · · · + xi + · · · ≤ 28. (3)
2 2
2 1
Taking (1) − 3 × (2) + 3 × (3) gives

1 1 (i − 2)(i − 3) 68
x1 + x4 + · · · + xi + · · · ≤ n − .
3 3 6 3
The coefficients on the left-hand side are all nonnegative. Hence n is at least 23.
The following construction shows that 23 is indeed enough. Each line represents a box and each
intersection ◦ represents a color.
More generally, we have the following Lemmas.
Lemma 1. There are b boxes with an average of a balls each box. Each ball has been colored with
one of n colors, such that no two balls in the same box are the same color, and no two colors occur
together in more than one box. Then
µ ¶
2 2 b
n≥ ab − ,
r+1 r(r + 1) 2
§ b−1 ¨
where r = a .
Mathematics Olympiad Coachs Seminar, Zhuhai, China 15

Proof: Let xi be the number of colors that occur exactly i times. Then we have the following linear
system:
X
(4) : xi = x1 + x2 + · · · + xi + · · · = n,
i≥1
X
(5) : ixi = x1 + 2x2 + · · · + ixi + · · · = ab,
i≥1
X µi¶ µ ¶
i
µ ¶
b
(6) : xi + y = x2 + · · · + xi + · · · + y = ,
2 2 2
i≥1

where y is a slack variable, denoting the number§ of¨ pairs of boxes with no 2like-colored balls. To solve
this linear system in real numbers xi , let r = b−1
a ; then combine (4) − r+1 × (5) + 2
r(r+1) × (6). We
obtain
X (r − i)(r − i + 1) 2
xi + y
r(r + 1) r(r + 1)
i≥1
µ ¶
2 2 b
= n− ab + .
r+1 r(r + 1) 2
Since all of the coefficients on the left-hand-side of the last equation are nonnegative, we have
µ ¶
2 2 b
n≥ ab − ,
r+1 r(r + 1) 2
as desired.
Since the coefficients of xr and xr+1 in the last equation are 0, and that it is possible to realize this
bound in reals by setting y = xi = 0, where i 6= r and i 6= r + 1. Then (5) and (6) become

rxr + (r + 1)xr+1 = ab,


µ ¶ µ ¶ µ ¶
r r+1 b
xr + xr+1 = .
2 2 2
Solving the last system of equations in two variables leads to
µ ¶ µ µ ¶ ¶
2 b 1 b
xr = ab − and xr+1 = 2 − ab .
r 2 r+1 2
Hence the lower bound is indeed obtainable.
Lemma 2. Suppose that each of m + 2 boxes contains m balls. Let nm denote the smallest integer
n for which it is possible to color each ball with one of n colors, such that no two balls in the same
box are the same color, and no two colors occur together in more than one box. Then n0 = 0, n1 = 1,
and


 9k 2 − k

 m = 3k − 1,

 2
2
9k + 5k
nm = m = 3k,

 9k 2 2+ 11k + 2



 m = 3k + 1,
2
for positive integers k.
16 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Proof: When m = 0 and m = 1, the results are trivial. We assume that m ≥ 3. By Lemma 1, we
have r = 2 and µ ¶
2 1 a+2
n ≥ a(a + 2) − ,
3 3 2
or
1
n ≥ (3a − 1)(a + 2).
6
This gives

m 2 3 4 5 6 7 8 9 10
10 20 49 68 115 141
lower bound 3 3 11 3 3 30 3 3 58
nm 4 7 11 17 23 30 39 48 58
The values of n can indeed be achieved. We can construct our examples inductively. Again, let lines
represent boxes and let their intersections ◦ represent different colors.
For m = 2, we have
For m = 3, we have
For m = 4, we have
If Gk is the construction for m = k, we add
to Gk to obtain Gk+3 the construction for m = k + 3. (One can compare the construction for G3 and
G6 , which appeared earlier. One can also see the construction for G5 and G8 .)
Therefore nm+3 = nm + 3(m + 2) + 1, for m ≥ 2. For m = 3k, we have

(k + 1)k
n3(k+1) = n3k + 9k + 7 = n3 + 9 · + 7k
2
9k 2 + 23k + 14
= ,
2
or
9k 2 + 5k
n3k = .
2
Similarly, we have
9k 2 + 11k + 2 9k 2 − k
n3k+1 = and n3k−1 = ,
2 2
as desired.

21. Each point in the plane is assigned a real number such that, for any triangle, the number at the
center of its inscribed circle is equal to the arithmetic mean of the three numbers at its vertices.
Prove that all points in the plane are assigned the same number.

Solution: Let A, B be arbitrary distinct points, and consider a regular hexagon ABCDEF in
the plane. Let lines CD and F E intersect at G. Let ` be the line through G perpendicular to line
ED. Then A, F, E and B, C, D are symmetric to each other, respectively, with respect to line `.
Hence triangles CEG and DF G share the same incenter, i.e., c + e = d + f ; triangles ACE and BDF
share the same incenter, i.e., a + c + e = b + d + f . Therefore, a = b, and we are done.
Mathematics Olympiad Coachs Seminar, Zhuhai, China 17

22. Let n be a positive integer and let S be a set of 2n + 1 elements. Let f be a function from the set
of two-element subsets of S to {0, . . . , 2n−1 − 1}. Assume that for any elements x, y, z of S, one of
f ({x, y}), f ({y, z}), f ({z, x}) is equal to the sum of the other two. Show that there exist a, b, c in S
such that f ({a, b}), f ({b, c}), f ({c, a}) are all equal to 0.

Solution: We prove the result by induction on n, the case n = 1 being obvious. Pick w ∈ S
and and set f (w, w) = 0. We partition S into subsets U and V by putting x ∈ S into U if f ({w, x})
is even and into V if f ({w, x}) is odd (hence
§ n w ¨is in U ). By the Pigeonhole Principle, at least
one of U or V , say U , contains a subset of 2 2+1 = 2n−1 + 1 elements.

Note that the given condition implies that the sum f ({x, y}) + f ({y, z}) + f ({z, x}) is even for any
x, y, z ∈ S. In particular, if x and y are both in U or both in V , then f ({w, x}) + f ({w, y}) is even,
so f ({x, y}) is even. Hence f maps the two-element subsets of U into {0, . . . , 2n−1 − 2}. Of course
the condition on f is preserved by dividing all values by 2; then the induction hypothesis applies to
show that some x, y, z ∈ U satisfy f ({x, y}) = f ({y, z}) = f ({z, x}) = 0, as desired.

23. For a pair of integers a and b, with 0 < a < b < 1000, the set S ⊆ {1, 2, . . . , 2003} is called a skipping
set for (a, b) if for any pair of elements s1 , s2 ∈ S, |s1 − s2 | 6∈ {a, b}. Let f (a, b) be the maximum size
of a skipping set for (a, b). Determine the maximum and minimum values of f .

Note: This problem caused unexpected difficulties for students. It requires two ideas: applying
the greedy algorithm to obtain the minimum and applying the Pigeonhole Principle on congruence
classes to obtain the maximum. Most students were successful in getting one of the two ideas and
obtaining one of the extremal values quickly, but then many of them failed to switch to the other idea.
In turn, their solutions for the second extremal value were very lengthy and sometimes unsuccessful.

Solution: The maximum and minimum values of f are 1334 and 338, respectively.

(a) First, we will show that the maximum value of f is 1334. The set S = {1, 2, . . . , 667} ∪
{1336, 1337, . . . , 2002} is a skipping set for (a, b) = (667, 668), so f (667, 668) ≥ 1334.
Now we prove that for any 0 < a < b < 1000, f (a, b) ≤ 1334. Because a 6= b, we can choose
d ∈ {a, b} such that d 6= 668. We assume first that d ≥ 669. Then consider the 2003 − d ≤ 1334
sets {1, d + 1}, {2, d + 2}, . . . , {2003 − d, 2003}. Each can contain at most one element of S, so
|S| ≤ 1334.
§ ¨ § ¨
We assume second that d ≤ 667 and that 2003 a is even, that is, 2003
a = 2k for some positive
integer k. Then each of the congruence classes of 1, 2, . . . , 2003 modulo a contains at most 2k
elements. Therefore at most k members of each of these congruence classes can belong to S.
Consequently,
µ ¶
1 2003 2003 + a
|S| ≤ ka < +1 a= ≤ 1335,
2 a 2

implying that |S| ≤ 1334.


§ ¨ § ¨
Finally, we assume that d ≤ 667 and that 2003 a is odd, that is, 2003
a = 2k + 1 for some
positive integer k. Then, as before, S can contain at most k elements from each congruence
18 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

class of {1, 2, . . . , 2ka} modulo a. Then

|S| ≤ ka + (2003 − 2ka) = 2003 − ka


ç ¨ !
2003
a − 1
= 2003 − a
2
à !
2003
a −1
≤ 2003 − a
2
2003 + a
= ≤ 1335.
2
The last inequality holds if and only if a = 667. But if a = 667, then 2003
a is not an integer, and
so the second inequality is strict. Thus, |S| ≤ 1334. Therefore the maximum value of f is 1334.
(b) We will now show that the minimum value of f is 668. First, we will show that f (a, b) ≥ 668
by constructing a skipping set S for any (a, b) with |S| ≥ 668. Note that if we add x to S, then
we are not allowed to add x, x + a, or x + b to S at any later time. Then at each step, let
us add to S the smallest element of {1, 2, . . . , 2003} that is not already in S and that has not
already been disallowed from being in S. Then since adding this element prevents at most
§ 2003 ¨ three
elements from being added at any future time, we can always perform this step 3 = 668
times. Thus, |S| ≥ 668, so f (a, b) ≥ 668. Now notice that if we let a = 1, b = 2, then at most
one element from each of the 668 sets {1, 2, 3}, {4, 5, 6}, . . . , {1999, 2000, 2001}, {2002, 2003}
can belong to S. This implies that f (1, 2) = 668, so indeed the minimum value of f is 668.

24. Let n be an integer greater than 2, and P1 , P2 , · · · , Pn distinct points in the plane. Let S denote
the union of the segments P1 P2 , P2 P3 , . . . , Pn−1 Pn . Determine whether it is always possible to find
points A and B in S such that P1 Pn k AB (segment AB can lie on line P1 Pn ) and P1 Pn = kAB,
where (1) k = 2.5; (2) k = 3.

Solution: The answer is negative for k = 2.5 and positive for k = 3.

(1) Let n = 6, P1 = (0, 0), P2 = (5, 0), P3 = (5, 5), P4 = (10, 5), P5 = (10, 10), P6 = (15, 10).

P50 P60
P5 P6

P30 P40
P3 P4

P10 P20
P1 P2
−−−→
Then for 1 ≤ i ≤ 6, let Pi0 = Pi + 25 P1 P6 . Because S and its image under this transforma-
−−−→ −−→
tion do not intersect, there are no two points A, B in S such that P1 P6 = 25 AB, so this is a
counterexample.
(2) The answer is yes; in fact, it is yes for all positive integers k. We approach indirectly. The
statement is obviously true for k = 1, because we can have A = P1 and B = Pn . Assume
to the contrary that the claim is false for some positive integer k ≥ 2; let P1 , . . . , Pn be a
counterexample. Introduce a coordinate system in which P1 = (0, 0) and Pn = (k, 0).
Choose indices T, B ∈ {1, . . . , n} so that the y-coordinate of PT is maximal, the y-coordinate
of PB is minimal, and |T − B| is as small as possible. Assume without loss of generality that
Mathematics Olympiad Coachs Seminar, Zhuhai, China 19

T < B (because we can relabel the points backward otherwise). Let M be the region in the
plane consisting of points whose y-coordinates lie between those of PB and PT , inclusive; then
PT +1 , . . . , PB−1 lie in the interior of this region. Let D be the union of the closed segments
PT PT +1 , PT +1 PT2 , . . . , PB−1 PB .
Let X be a point on D with its x-coordinate no smaller than that of any point on D. (On
polygonal path D, X is indeed one of points PT , PT +1 , . . . , PB .) For P ∈ M not lying on D, we
say P is right of D if there is a continues curve connecting P and X not intersecting D besides
at X. Otherwise, we say P is to the left of D. (That is, we split M into left and right sides
using D as the border line.) For any figure F , let F (x) denote the image of F under translation
by the vector [x, 0], and put F 0 = F (1) . We define right of (or left of) D(x) analogously.
Note that any polygonal path in M not intersecting D consists entirely either of points right of
D or of points left of D. (If P is a point on and the path and P is right of D, then there is a
continues curve connecting P and X not intersecting D besides at X. If Q is an other point on
the path, then there is a continues path from Q to P to X not intersecting D besides at X, and
so Q is right of D.) By hypothesis, S and S 0 are disjoint, so D and S 0 are disjoint. Because X 0
is on S 0 and is clearly right of D, so is all of S 0 ; in particular, D0 is right of D. By translation,
D(2) is right of D0 and hence of D as well; by induction, D(i) is right of D for all i = 1, 2, . . . .
(k)
Because k ≥ 2, D(k−1) is right of D and so D(k) is right of D0 . In particular, Pn = P1 is
right of D0 . But that means that all of S is right of D0 and hence of D, which is impossible
because D ⊆ S. Thus our assumption was wrong and the statement in the problem is true for
all positive integers k.

25. At the vertices of a regular hexagon are written six nonnegative integers whose sum is 2003. Bert is
allowed to make moves of the following form: he may pick a vertex and replace the number written
there by the absolute value of the difference between the numbers written at the two neighboring
vertices. Prove that Bert can make a sequence of moves, after which the number 0 appears at all six
vertices.

Note: Let
B C
A D
F E
denote a position, where A, B, C, D, E, F denote the numbers written on the vertices of the hexagon.
We write
B C
A D (mod 2)
F E
if we consider the numbers written modulo 2.
This is the hardest problem on the test. Many students thought they had considerable progress.
Indeed, there were only a handful of contestants who were able to find some algorithm without major
flaws. Richard Stong, one of the graders of this problem, wrote the following summary.
There is an obvious approach one can take to reducing this problem, namely the greedy algorithm:
reducing the largest value. As is often the case, this approach is fundamentally flawed. If the initial
values are
3 2
1 5
n7
where n is an integer greater than 7, then the first move following the greedy algorithm gives
32
1 5.
67
20 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

No set of moves can lead from these values to the all zeroes by a parity argument. This example also
shows that there is no sequence of moves which always reduces the sum of the six entries and leads
to the all zeroes. A correct solution to the problem requires first choosing some parity constraint to
avoid the
10
1 1 (mod 2)
01
situation, which is invariant under the operation. Secondly one needs to find some moves that preserve
the chosen constraint and reduce the six values.

Solution: Define the sum and maximum of a position to be the sum and maximum of the six
numbers at the vertices. We will show that from any position in which the sum is odd, it is possible
to reach the all-zero position.
Our strategy alternates between two steps:
(a) from a position with odd sum, move to a position with exactly one odd number;
(b) from a position with exactly one odd number, move to a position with odd sum and strictly
smaller maximum, or to the all-zero position.
Note that no move will ever increase the maximum, so this strategy is guaranteed to terminate,
because each step of type (b) decreases the maximum by at least one, and it can only terminate at
the all-zero position. It suffices to show how each step can be carried out.
First, consider a position
B C
A D
F E
with odd sum. Then either A + C + E or B + D + F is odd; assume without loss of generality that
A + C + E is odd. If exactly one of A, C and E is odd, say A is odd, we can make the sequence of
moves
B 0 10 10 1 0
1 D→1 0→0 0→0 0 (mod 2),
F 0 10 10 00
where a letter or number in boldface represents a move at that vertex, and moves that do not affect
each other have been written as a single move for brevity. Hence we can reach a position with exactly
one odd number. Similarly, if A, C, E are all odd, then the sequence of moves
B 1 01 00
1 D→1 0→1 0 (mod 2),
F 1 01 00
brings us to a position with exactly one odd number. Thus we have shown how to carry out step (a).
Now assume that we have a position
B C
DA
F E
with A odd and all other numbers even. We want to reach a position with smaller maximum. Let
M be the maximum. There are two cases, depending on the parity of M .
• In this case, M is even, so one of B, C, D, E, F is the maximum. In particular, A < M .
We claim after making moves at B, C, D, E, and F in that order, the sum is odd and the
maximum is less than M . Indeed, the following sequence
0 0 1 0 11
1 0→1 0→1 0
0 0 0 0 0 0
1 1 1 1 1 1
→ 1 1→1 1→1 1 (mod 2).
0 0 0 1 01
Mathematics Olympiad Coachs Seminar, Zhuhai, China 21

B0 C 0 0
shows how the numbers change in parity with each move. Call this new position A0 D.
0 0 0 0
F00 E 0
The sum is odd, since there are five odd numbers. The numbers A , B , C , D , E are all
less than M , since they are odd and M is even, and the maximum can never increase. Also,
F 0 = |A0 − E 0 | ≤ max{A0 , E 0 } < M . So the maximum has been decreased.
• In this case, M is odd, so M = A and the other numbers are all less than M .
If C > 0, then we make moves at B, F , A, and F , in that order. The sequence of positions is
0 0 1 0 1 0
1 0→1 0→1 0
0 0 0 0 10
1 0 1 0
→ 0 0→0 0 (mod 2).
1 0 0 0
B0 C 0 0
Call this new position A0 D . The sum is odd, since there is exactly one odd number. As
F 0 E0
before, the only way the maximum could not decrease is if B 0 = A; but this is impossible, since
B 0 = |A − C| < A because 0 < C < M = A. Hence we have reached a position with odd sum
and lower maximum.
If E > 0, then we apply a similar argument, interchanging B with F and C with E.
If C = E = 0, then we can reach the all-zero position by the following sequence of moves:
B 0 A0 A0 00
A D→A 0→0 0→0 0.
F 0 A0 A0 00
(Here 0 represents zero, not any even number.)

Hence we have shown how to carry out a step of type (b), proving the desired result. The problem
statement follows since 2003 is odd.

Note: Observe that from positions of the form


11
0 0 (mod 2) or rotations
11
it is impossible to reach the all-zero position, because a move at any vertex leaves the same value
modulo 2. Dividing out the greatest common divisor of the six original numbers does not affect
whether we can reach the all-zero position, so we may assume that the numbers in the original
position are not all even. Then by a more complete analysis in step (a), one can show from any
position not of the above form, it is possible to reach a position with exactly one odd number, and
thus the all-zero position. This gives a complete characterization of positions from which it is possible
to reach the all-zero position.
There are many ways to carry out the case analysis in this problem; the one used here is fairly
economical. The important idea is the formulation of a strategy that decreases the maximum value
while avoiding the “bad” positions described above.

Second Solution: (By Richard Stong) We will show that if there is a pair of opposite ver-
tices with odd sum (which of course is true if the sum of all the vertices is odd), then we can reduce
to a position of all zeros.
Focus on such a pair {a, d} with smallest possible max{a, d}. We will show we can always reduce
this smallest maximum of a pair of opposite vertices with odd sum or reduce to the all-zero position.
22 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Because the smallest maximum takes nonnegative integer values, we must be able to achieve the
all-zero position.
To see this assume without loss of generality that a ≥ d and consider an arc (a, x, y, d) of the position
xy
a d
∗ ∗
Consider updating x and y alternately, starting with x. If max{x, y} > a, then in at most two updates
we reduce max{x, y}. Thus, we can repeat this alternate updating process and we must eventually
reach a point when max{x, y} ≤ a, and hence this will be true from then on.
Under this alternate updating process, the arc of the hexagon will eventually enter a unique cycle of
length four modulo 2 in at most one update. Indeed, we have
00 10 11 01 00
1 0→1 0→1 0→1 0→1 0 (mod 2)
∗∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗
and
00 00 10 10
1 0→1 0 (mod 2); 1 0→1 0 (mod 2)
∗∗ ∗ ∗ ∗∗ ∗ ∗
11 11 01 01
1 0→1 0 (mod 2); 1 0→1 0 (mod 2),
∗∗ ∗ ∗ ∗∗ ∗ ∗
or
01 11 10 00 01
0 1→0 1→0 1→0 1→0 1 (mod 2)
∗∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗
and
00 00 01 01
0 1→0 1 (mod 2); 0 1→0 1 (mod 2)
∗∗ ∗ ∗ ∗∗ ∗ ∗
11 10 10 10
0 1→0 1 (mod 2); 0 1→0 1 (mod 2).
∗∗ ∗ ∗ ∗∗ ∗ ∗
Further note that each possible parity for x and y will occur equally often.
Applying this alternate updating process to both arcs (a, b, c, d) and (a, e, f, d) of
b c
a d,
f e
we can make the other four entries be at most a and control their parity. Thus we can create a
position
x1 x2
a d
x5 x4
with xi + xi+3 (i = 1, 2) odd and Mi = max{xi , xi+3 } ≤ a. In fact, we can have m = min{M1 , M2 } <
a, as claimed, unless both arcs enter a cycle modulo 2 where the values congruent to a modulo 2 are
always exactly a. More precisely, because the sum of xi and xi+3 is odd, one of them is not congruent
to a and so has its value strictly less than a. Thus both arcs must pass through the state (a, a, a, d)
(modulo 2, this is either (0, 0, 0, 1) or (1, 1, 1, 0)) in a cycle of length four. It is easy to check that for
this to happen, d = 0. Therefore, we can achieve the position
aa
a 0.
aa
From this position, the sequence of moves
aa 0a 00
a 0→a 0→0 0
aa 0a 00
Mathematics Olympiad Coachs Seminar, Zhuhai, China 23

completes the task.

Third Solution: (By Tiankai Liu) In the beginning, because A + B + C + D + E + F is odd,


either A + C + E or B + D + F is odd; assume without loss of generality it is the former. Perform
the following steps repeatedly.

a. In this case we assume that A, C, E are all nonzero. Suppose without loss of generality that
A ≥ C ≥ E. Perform the sequence of moves
B C (A − C ) C
A D → A (C − E )
F E (A − E ) E
(A − C) C
→ (C − E ) (C − E),
(A − E) (A − C )
which decreases the sum of the numbers in positions A, C, E while keeping that sum odd.
b. In this case we assume that exactly one among A, C, E is zero. Assume without loss of generality
that A ≥ C > E = 0. Then, because A + C + E is odd, A must be strictly greater than C.
Therefore, −A < A − 2C < A, and the sequence of moves
B C (A − C ) C
A D → A C
F 0 A 0
(A − C) |A − 2C |
→ C C,
A 0
decreases the sum of the numbers in positions A, C, E while keeping that sum odd.
c. In this case we assume that exactly two among A, C, E are zero. Assume without loss of
generality that A > C = E = 0. Then perform the sequence of moves
B 0 A0 A0 00
A D→A 0→0 0→0 0.
F 0 A0 A0 00
By repeatedly applying step (a) as long as it applies, then doing the same for step (b) if necessary,
00
and finally applying step (c) if necessary, 0 0 can eventually be achieved.
00
26. Let n be a positive integer. A corner is a finite set C of ordered n-tuples of positive integers
such that if a1 , a2 , . . . , an , b1 , b2 , . . . , bn are positive integers with ak ≥ bk for k = 1, 2, . . . , n and
(a1 , a2 , . . . , an ) ∈ C, then (b1 , b2 , . . . , bn ) ∈ C. Prove that among any infinite collection S of corners,
there exist two corners, one of which is a subset of the other one.

Solution: (by Reid Barton) If a = (a1 , . . . , an ) and b = (b1 , . . . , bn ), we write a ≤ b if ai ≤ bi


for i = 1, . . . , n. We first note that every sequence of n-tuples of positive integers contains a sub-
sequence which is nondecreasing with this definition. For n = 1, we may simply pick the smallest
term, then the smallest term that comes later in the sequence, and so on. For general n, first pick a
subsequence which is nondecreasing in its first coordinate, then pick a subsequence of that which is
also nondecreasing in its second coordinate, and so on.
For the sake of contradiction, suppose that there are no corners A, B ∈ S with A ⊂ B. Let C1 be a
corner in S; then each other corner in S fails to contain one of the n-tuples in C1 . Since S is infinite
and C1 is finite, there exists an n-tuple a1 in C1 such that the set S1 of corners not containing a1 is
infinite.
24 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Now let C2 be a corner in S1 ; again, we may find an n-tuple a2 in C2 such that the set S2 of corners
not containing a2 is infinite. Analogously, we recursively construct sequences Ck of corners, Sk of
infinite sets of corners and ak of n-tuples such that Ck is a corner in Sk−1 , ak is an n-tuple in Ck and
Sk is the set of corners in Sk−1 not containing ak .
To conclude, simply notice that ai 6≤ aj for i ≤ j, since aj is an element of a corner which does not
contain ai . This contradicts the result of the first paragraph.

Note: The assertion of the problem still holds if corners are not required to be finite; this state-
ment is a recent theorem of Diane Maclagan, which turns out to yield a nontrivial result in algebraic
geometry.

27. Suppose that r1 , . . . , rn are real numbers. Prove that there exists S ⊆ {1, 2, . . . , n} such that

1 ≤ |S ∩ {i, i + 1, i + 2}| ≤ 2,

for 1 ≤ i ≤ n − 2, and ¯ ¯
¯X ¯ 1 X n
¯ ¯
¯ ri ¯ ≥ |ri |.
¯ ¯ 6
i∈S i=1

Pn
Solution: Let s = i=1 |ri |
and for i = 0, 1, 2, define
X X
si = rj and ti = rj .
rj ≥0,j≡i (mod 3) rj <0,j≡i (mod 3)

Then we have s = s1 + s2 + s3 − t1 − t2 − t3 , or

2s = (s1 + s2 ) + (s2 + s3 ) + (s3 + s1 )


−(t1 + t2 ) − (t2 + t3 ) − (t3 + t1 ).

Therefore there are i1 6= i2 such that either si1 + si2 ≥ 3s or ti1 + ti2 ≤ − 3s or both. Without loss of
generality, we assume that si1 + si2 ≥ 3s and |si1 + si2 | ≥ |ti1 + ti2 |. Thus si1 + si2 + ti1 + ti2 ≥ 0. We
have
s
(si1 + si2 + ti1 ) + (si1 + si2 + ti2 ) ≥ si1 + si2 ≥ .
3
Therefore at least one of si1 + si2 + ti1 and si1 + si2 + ti2 is greater than or equal to 6s and we are
done.

1
Note: By setting r1 = r2 = r3 = 1 and r4 = r5 = r6 = −1, it is easy to prove that 6 is the
best value for the bound.

28. An m × n array is filled with the numbers {1, 2, . . . n} each being used exactly m times. Show that
one can always permute the numbers within columns to arrange that each row contains every number
{1, 2, . . . , n} exactly once.

Solution: It suffices to show that we can permute the numbers within columns to arrange that
top row contains every number 1, 2, . . . , n exactly one. The result then follows by induction on the
number of rows. For this we apply the Marriage theorem. For the boys take the columns, for the girls
take the numbers {1, 2, . . . , n} and say a boy (column) likes a girl (number) if that number occurs in
Mathematics Olympiad Coachs Seminar, Zhuhai, China 25

the column. For each set of k columns, there are a total of km numbers in those columns. Therefore
there must be at least k different distinct numbers among them. Therefore there is a marriage of
the columns and the numbers they contain. Permuting these numbers to the top of their respective
columns makes the first row have all n numbers.

29. Suppose that C1 , C2 , . . . , Cn are circles of radius 1 in the plane such that no two of them are tangent
and the subset of the plane formed by the unionSof these circles S is connected (i.e., for any partition
of {1, 2, . . . , n} into nonempty subsets A and B, a∈A Ca and b∈B Cb are not disjoint). Prove that
|S| ≥ n, where [
S= Ci ∩ Cj ,
1≤i<j≤n

the set of intersection points of the circles. (Each circle is viewed as the set of points on its circum-
ference, not including its interior.)

Solution: Let T = {C1 , C2 , . . . , Cn }. For every s ∈ S and C ∈ T define

0, if s 6∈ C,
f (s, C) = { 1
k , if s ∈ C,

where k is the number of circles passing through s (including C). Thus


X
f (s, C) = 1
C∈T

for every s ∈ S.
On the other hand, for a fixed circle C ∈ T, let s0 ∈ S ∩ C be a point such that

f (s0 , C) = min{f (s, C) | s ∈ S ∩ C}.

Suppose that C, C2 , . . . Ck are the circles which pass through s0 . Then C meets C2 , . . . , Ck again in
distinct points s2 , . . . , sk . Therefore
X 1 k−1
f (s, C) ≥ + = 1.
k k
s∈C

We have XX XX
|S| = f (s, C) = f (s, C) ≥ n,
s∈S C∈T C∈T s∈S

as desired.

30. Let S = {x0 , x1 , . . . , xn } ⊂ [0, 1] be a finite set of real numbers with x0 = 0, x1 = 1, such that every
distance between pairs of elements occurs at least twice, except for the distance 1. Prove that all of
the xi are rational.

Solution: The set S spans some finite-dimensional vector space over Q; let β1 , . . . , βm be a basis
of this vector space with βm = 1. For each i, we write

xi = qi1 β1 + · · · + qim βm

and define the vector vi = (qi1 , . . . , qim ).


26 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Let us compare the vi in lexicographic order: vi > vj if in the first position where they differ, vi has
the larger component. Let vs and vt be the largest and smallest of the vi , respectively, and suppose
a and b are such that xs − xt = xa − xb ; since the βk form a basis, this also implies vs − vt = va − vb .
By our choice of vs and vt , this can only happen if a = s and b = t. Thus for 0 < i < n,

vs = (0, 0, . . . , 1) > vi > vt = (0, 0, . . . , 0).

This is only possible if the vi only have nonzero entries in the last component, which is to say the xi
are all rational.

31. Suppose that S = {1, 2, . . . , n} and that A1 , A2 , . . . , Ak are subsets of S such that for every 1 ≤
i1 , i2 , i3 , i4 ≤ k, we have
|Ai1 ∪ Ai2 ∪ Ai3 ∪ Ai4 | ≤ n − 2.
Prove that k ≤ 2n−2 .

Solution: For a set T , let |T | denote the numbers of elements in T . We call a set T ⊆ S 2-
coverable if T ⊆ Ai ∪ Aj for some i and j (not necessarily distinct). By the given condition, for any
subset T of S at least one of the sets T and S − T is not 2-coverable. Among the subsets of S that
are not 2-coverable, let A be a subset with minimum |A|.
Consider the family of sets S1 = {A ∩ A1 , A ∩ A2 , . . . , A ∩ Ak }. (A ∩ Ai might equal A ∩ Aj for some
distinct i and j, but we ignore any duplicate sets.) Because A is not 2-coverable, if X ∈ S1 , then
A − X 6∈ S1 . Thus, at most half the subsets of |A| are in S1 , and |S1 | ≤ 2|A|−1 .
On the other hand, let B = S − A and consider the family of sets S2 = {B ∩ A1 , B ∩ A2 , . . . , B ∩ Ak }.
We claim that if X ∈ S2 , then B − X 6∈ S2 . Suppose on the contrary that both X, B − X ∈ S2 for
some X = B ∩ A` and B − X = B ∩ A`0 . By the minimal definition of A, there are Ai and Aj such
that Ai ∪ Aj = A \ {m} for some i, j, and m. Then

|A` ∪ A`0 ∪ Ai ∪ Aj | = n − 1,

a contradiction. Thus our assumption is false and |S2 | ≤ 2|B|−1 = 2n−|A|−1 .


Because every set Ai is uniquely determined by its intersection with sets A and B = S − A, it follows
that k ≤ |S1 | · |S2 | ≤ 2n−2 .

32. Numbers 1, 2, . . . , 2004 are arranged in a row such that each number is either greater than all of the
numbers to its left or less than all of the numbers to its right. How many such arrangements are
there?
Mathematics Olympiad Coachs Seminar, Zhuhai, China 1

03/23/2004

Number Theory
1. Prove that for every positive integer n there exists an n-digit number divisible by 5n all of whose
digits are odd.

2. Determine all finite nonempty sets S of positive integers satisfying


i+j
is an element of S for all i, j in S,
gcd(i, j)
where gcd(i, j) is the greatest common divisor of i and j.

3. Suppose that the set {1, 2, · · · , 1998} has been partitioned into disjoint pairs {ai , bi } (1 ≤ i ≤ 999)
so that for all i, |ai − bi | equals 1 or 6. Prove that the sum

|a1 − b1 | + |a2 − b2 | + · · · + |a999 − b999 |

ends in the digit 9.

Solution: Let k denote the number of pairs {ai , bi } with |ai − bi | = 6. Then the sum in question
is k · 6 + (999 − k) · 1 = 999 + 5k, which ends in 9 provided k is even. Hence it suffices to show that
k is even.
Write k = kodd +keven , where kodd (resp. keven ) is equal to the number of pairs {ai , bi } with ai , bi both
odd (resp. even). Since there are as many even numbers as odd numbers between 1 and 1998, and
since each pair {ai , bi } with |ai −bi | = 1 contains one number of each type, we must have kodd = keven .
Hence k = kodd + keven is even as claimed.

4. For a real number x, let bxc denote the largest integer that is less than or equal to x. Prove that
¹ º
(n − 1)!
n(n + 1)
is even for every positive integer n.

5. Let p1 , p2 , p3 , . . . be the prime numbers listed in increasing order, and let x0 be a real number between
0 and 1. For positive integer k, define
½ ¾
pk
xk = 0 if xk−1 = 0, if xk−1 6= 0,
xk−1
where {x} = x − bxc denotes the fractional part of x. Find, with proof, all x0 satisfying 0 < x0 < 1
for which the sequence x0 , x1 , x2 , . . . eventually becomes 0.

Solution: The sequence eventually becomes 0 if and only if x0 is a rational number.


First we prove that, for k ≥ 1, every rational term xk has a rational predecessor xk−1 . Suppose xk is
rational. If xk = 0 then either xk−1 = 0 or pk /xk−1 is a positive integer; either way, xk−1 is rational.
If xk is rational and nonzero, then the relation
½ ¾ ¹ º
pk pk pk
xk = = −
xk−1 xk−1 xk−1
2 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

yields
p
xk−1 = ¹k º,
pk
xk +
xk−1
which shows that xk−1 is rational. Since every rational term xk with k ≥ 1 has a rational predecessor,
it follows by induction that, if xk is rational for some k, then x0 is rational. In particular, if the
sequence eventually becomes 0, then x0 is rational.
To prove the converse, observe that if xk−1 = m/n with 0 < m < n, then xk = r/m, where r is
the remainder that results from dividing npk by m. Hence the denominator of each nonzero term is
strictly less than the denominator of the term before. In particular, the number of nonzero terms in
the sequence cannot exceed the denominator of x0 .
Note that the above argument applies to any sequence {pk } of positive integers, not just the sequence
of primes.

6. A square can be cut into n congruent squares, and a square can be cut into n + m congruent squares.
Determine all m such that the values of n is unique.

7. Prove that for each n ≥ 2, there is a set S of n integers such that (a − b)2 divides ab for every distinct
a, b ∈ S.

Solution: We will prove by induction on n, that we can find such a set Sn , all of whose ele-
ments are nonnegative. For n = 2, we may take S2 = {0, 1}.
Now suppose that for some n ≥ 2, the desired set Sn of n nonnegative integers exists. Let L be the
least common multiple of those numbers (a − b)2 and ab that are nonzero, with (a, b) ranging over
pairs of distinct elements from Sn . Define

Sn+1 = {L + a : a ∈ Sn } ∪ {0}.

Then Sn+1 consists of n + 1 nonnegative integers, since L > 0. If α, β ∈ Sn+1 and either α of β is
zero, then (α − β)2 divides αβ. If L + a, L + b ∈ Sn+1 , with a, b distinct elements of Sn , then

(L + a)(L + b) ≡ ab ≡ 0 (mod(a − b)2 ),

so [(L + a) − (L + b)]2 divides (L + a)(L + b), completing the inductive step.

8. Let M be the number of integer solutions of the equations

x2 − y 2 = z 3 − t3

with the property 0 ≤ x, y, z, t ≤ 106 , and let N be the number of integer solutions of the equation

x2 − y 2 = z 3 − t3 + 1

that have the same property. Prove that M > N .

Solution: Write down two equations in the form

x2 + t3 = y 2 + z 3 and x2 + t3 = y 2 + z 3 + 1
Mathematics Olympiad Coachs Seminar, Zhuhai, China 3

and, for each k = 0, 1, 2, . . . , denote y nk the number of integer solutions of the equations u2 + v 3 = k
with the property 0 ≤ u, v ≤ 106 . Clearly nk = 0 for all k greater than ` = (106 )2 + (106 )3 . Note
that
M = n20 + n21 + · · · + n2` and N = n0 n1 + n1 n2 + · · · + n`−1 n` . (1)

To prove, for example, the second of these equalities, note that to any integer solution of x2 + y 3 =
y 2 + z 3 + 1 with ) ≤ x, y, z, t ≤ 106 there corresponds a k (1 ≤ k ≤ `) such that

x2 + t3 = k and y 2 + z 3 = k − 1. (2)

And for any such k, the pairs (x, t) and (y, z) satisfying (2) can be chosen independently of one
another in nk and nk−1 ways, respectively. Hence for each k = 1, 2, . . . , ` there are nk−1 nk solutions
of x2 + t3 = y 2 + z 3 + 1 with x2 + y 3 = y 2 + z 3 + 1 = k, which implies the second equality in (1).
The proof of the first is essentially the same.
It is not hard to deduce from (1) that M > N. Indeed, a little algebra work shows that

n20 + (n0 − n1 )2 + (n1 − n2 )2 + · · · + (n`−1 − n` )2 + n2`


M −N = > 0,
2

since n0 = 1 > 0.

9. Let p be a prime number greater than 5. For any integer x, define

p−1
X 1
fp (x) = .
(px + k)2
k=1

Prove that for all positive integers x and y, the numerator of fp (x) − fp (y), when written in lowest
terms, is divisible by p3 .

Solution: We use the notation r ≡ s (mod n), for r and s rational numbers, to mean that
the numerator of r − s, when written in lowest terms, is divisible by n. This relation is symmetric
and transitive, just like congruence for integers.
It suffices to check that fp (x) ≡ fp (x + 1) (mod p3 ), or in other words,

p−1 µ
X ¶ p−1
X
1 1 (xp + i + p)2 − (xp + i)2
0 ≡ 2
− =
(xp + i) (xp + p + i)2 (xp + i)2 (xp + p + i)2
i=1 i=1
p−1
X p(2xp + 2i + p)
= (mod p3 ).
(xp + i)2 (xp + p + i)2
i=1

Of course, it suffices to show that after dividing both sides by p, the results are congruent modulo p2 .
For integer y and z, (y + zp)2 ≡ y(y + 2zp) (mod p2 ), so (y + zp)2 (y − 2zp) ≡ y(y + 2zp)(y − 2zp) ≡ y 3
(mod p2 ). Further suppose that y is not divisible by p. It follows that

1 y − 2zp
2
≡ (mod p2 ). (∗)
(y + zp) y3
4 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

(For a motivation of congruence (∗) please read the note at the end of the proof.) Thus
p−1
X 2i + p(2x + 1)
(xp + i)2 (xp + p + i)2
i=1
p−1
X 2i + p(2x + 1)
≡ (i − 2xp)[i − 2p(x + 1)]
i6
i=1
p−1
X 2i + p(2x + 1) 2
= [i − 2p(2x + 1)i + 4p2 x(x + 1)]
i6
i=1
p−1
X 2i + p(2x + 1)
≡ [i − 2p(2x + 1)]
i5
i=1
p−1
X 2i2 + pi(2x + 1) − 4pi(2x + 1) − 2p2 (2x + 1)2
=
i5
i=1
p−1
X X 1 p−1
2
≡ + 3p(2x + 1) (mod p2 ).
i3 i4
i=1 i=1

The rest of our proof is based on the following lemma.


Pp−1
Lemma. If n is an integer not divisible by p − 1, then i=1 in ≡ 0 (mod p).
Proof: Let g be a primitive root of p, that is, g is an integer relatively prime to p such that

{g, g 2 , . . . , g p−1 } ≡ {1, 2, . . . , p − 1} (mod p).

Because g is relatively prime to p,

{g · 1, g · 2, . . . , g · (p − 1)} ≡ {1, 2, 3, . . . , p − 1} (mod p).

Consequently,
p−1
X p−1
X p−1
X
in ≡ (ig)n = g n in
i=1 i=1 i=1
Pp−1
Because gn 6≡ 1 (mod p), we must have i=1 in ≡ 0 (mod p), as desired.
For p ≥ 7, we may apply this with n = −4. Combining this with the previous congruence, we get
p−1
X X 2 p−1
2i + p(2x + 1)
2 2
≡ (mod p2 ).
(xp + i) (xp + p + i) i3
i=1 i=1

Now note that


p−1
X p−1 µ
X ¶ p−1
X
2 1 1 p(p2 − 3pi + 3i2 )
≡ + ≡
i3 i 3 (p − i)3 i3 (p − i)3
i=1 i=1 i=1
p−1
X p−1
X 3p
3i2 p
≡ ≡ − 4 ≡ 0 (mod p2 ),
i3 (p − i)3 i
i=1 i=1

by the lemma. This proves the desired result.


Mathematics Olympiad Coachs Seminar, Zhuhai, China 5

Note: The congruence (∗) is suggested by formally expanding 1( y + zp)2 as an infinite series:

1
= y 2 (1 + p(z/y))−2 = y 2 (1 − 2p(z/y) + 3p2 (z/y)2 + · · · ).
(y + zp)2

This expansion of course does not converge in the real numbers; however, it does converge in a
different number system known as the p-adic numbers.

10. Let n be a positive integer, and let σ(n) denote the sum of the positive divisors of n, including 1 and
n itself. Prove that
σ(1) σ(2) σ(n)
+ + ··· + ≤ 2n.
1 2 n
11. Let a, b be integers greater than 2. Prove that there exists a positive integer k and a finite sequence
n1 , n2 , . . . , nk of positive integers such that n1 = a, nk = b, and ni ni+1 is divisible by ni + ni+1 for
each i (1 ≤ i < k).

Comment: We may say two positive integers a and b are connected, denoted by a ↔ b, if there
exists a positive integer k and a finite sequence n1 , n2 , . . . , nk of positive integers such that n1 = a,
nk = b, and ni ni+1 is divisible by ni + ni+1 for each i (1 ≤ i < k). The problem asks to prove that
a ↔ b for all a, b > 2.
It is not difficult to check that ↔ is an equivalence relation: it is reflexive (a ↔ a), symmetric (a ↔ b
implies b ↔ a). and transitive (a ↔ b, b ↔ c imply a ↔ c). We state this here so that it may be
used without further comment in all solutions.

First Solution: (by William Deringer) The condition (ni + ni+1 )kni ni+1 holds whenever ni+1 =
ni (d − 1), where d is any divisor of ni greater than 1. Indeed,

ni + ni+1 = ni dkn2i kn2i (d − 1) = ni ni+1 .

Therefore, if d is any divisor of n, then n ↔ n(d − 1)k for any nonnegative integer k, and n ↔
Qd−1
n(d − 1) ↔ n(d − 1)(d − 2) ↔ · · · ↔ n i=c i for any natural number c < d.
Whenever a > b > 2, there exists a natural number ` such that (b − 1)` > a. Let

(b−1)`
Y
X= i.
i=b

Then
a−1 a a a (b−1)` −1
Y Y Y Y Y
` `
a↔a i= i ↔ (b − 1) i ↔ (b − 1) i i = X,
i=b i=b i=b i=b i=a+1

and
(b−1)` −1
Y
` `
b ↔ b(b − 1) ↔ b(b − 1) i = X.
i=b+1

Therefore, a ↔ X and b ↔ X, so a ↔ b, as desired.


6 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Second Solution: Note that for any positive integer n with n ≥ 3, n ↔ 2n, as the sequence

n ↔ n(n − 1) ↔ n(n − 1)(n − 2) ↔ n(n − 2) ↔ 2n

satisfies the conditions of the problem. For any positive integer n ≥ 4, n0 = (n − 1)(n − 2) ≥ 3,
hence n0 ↔ 2n0 by the above argument. It follows that n ↔ n − 1 for n ≥ 4 by n0 ↔ 2n0 and by the
sequences

n ↔ n(n − 1) ↔ n(n − 1)(n − 2)


↔ n(n − 1)(n − 2)(n − 3) ↔ 2(n − 1)(n − 2)
↔ (n − 1)(n − 2) ↔ n − 1.

Iterating this, we connect all integers larger than 2.

Third Solution: Note that ni + ni+1 kni ni+1 if and only if

(ni + ni+1 )k[(ni + ni+1 )ni − ni ni+1 ] = n2i .

This means that ni+1 can be d − ni where d is any divisor of n2i , as long as that is positive. We
repeatedly use this to obtain the following facts.

• Fact 1 By successively taking ni = 4a, 4a(a − 1), 4a(a + 1), we have

4a ↔ 4a2 − 4a = 4a(a − 1) ↔ 8a2 − 4a(a − 1) = 4a(a + 1) ↔ 4(a + 1)2 − 4a(a + 1) = 4(a + 1)

for integers a ≥ 2.
• Fact 2 4 ↔ 42 − 4 = 12.
• Fact 3 2a ↔ 2a2 − 2a = 2a(a − 1) for all a ≥ 2.
• Fact 4 a ↔ a2 − a = a(a − 1) for all a ≥ 2.

We also note that a(a − 1) is even for all integers a.


The first two facts together prove that all positive multiples of 4 are connected. The third fact proves
that each even number ≥ 4 is connected to some multiple of 4, so by the first two results, all even
numbers ≥ 4 are connected. The fourth fact proves that all numbers ≥ 3 are connected to some even
number at least 4, so all numbers at least 3 are connected.

Fourth Solution: As in the first solution, observe that if d > 2 and n is a multiple of d, then
n ↔ (d − 1)n.
Let us call a positive integer k safe if n ↔ kn for all n > 2. Notice that any product of safe numbers
is safe. Now, we claim that 2 is safe. To prove this, define f (n), for n > 2, to be the smallest divisor
of n that is greater than 2. We show that n ↔ 2n by strong induction on f (n). In case f (n) = 3, we
immediately have n ↔ 2n by our initial observation. Otherwise, notice that f (n) − 1 is a divisor of
(f (n) − 1)n that is greater than 2 and less than f (n). By the minimality of f , f ((f (n) − 1)n) < f (n),
and so the induction hypothesis gives (f (n) − 1)n ↔ 2(f (n) − 1)n. We also have n ↔ (f (n) − 1)n
(by our earlier observation) and 2(f (n) − 1)n ↔ 2n (by the same observation, because f (n) divides
n, and so f (n) divides 2n). Thus, n ↔ 2n. This completes the induction step and proves the claim.
Mathematics Olympiad Coachs Seminar, Zhuhai, China 7

Next, we show that any prime p is safe, again by strong induction. The base case p = 2 has already
been done. If p is an odd prime, then p + 1 is a product of primes strictly less than p, which are safe
by the induction hypothesis; hence, p + 1 is safe. Thus, for any n > 2,

n ↔ (p + 1)n ↔ p(p + 1)n ↔ pn.

This completes the induction step. Thus, all primes are safe, and hence every integer ≥ 2 is safe. In
particular, our given numbers a, b are safe, so we have a ↔ ab ↔ b, as needed.

12. Find all ordered triples of primes (p, q, r) such that

p | q r + 1, q | rp + 1, r | pq + 1.

Solution: Answer: (2, 5, 3) and cyclic permutations.


We check that this is a solution:

2 | 126 = 53 + 1, 5 | 10 = 32 + 1, 3 | 33 = 25 + 1.

Now let p, q, r be three primes satisfying the given divisibility relations. Since q does not divide
q r + 1, p 6= q, and similarly q 6= r, r 6= p, so p, q and r are all distinct. We now prove a lemma.
Lemma. Let p, q, r be distinct primes with p | q r + 1, and p > 2. Then either 2r | p − 1 or
p | q 2 − 1.
Proof: Since p | q r + 1, we have

q r ≡ −1 6≡ 1 (mod p), because p > 2,

but
q 2r ≡ (−1)2 ≡ 1 (mod p).

Let d be the order of q mod p; then from the above congruences, d divides 2r but not r. Since r is
prime, the only possibilities are d = 2 or d = 2r. If d = 2r, then 2r | p − 1 because d | p − 1. If d = 2,
then q 2 ≡ 1 (mod p) so p | q 2 − 1. This proves the lemma.
Now let’s first consider the case where p, q and r are all odd. Since p | q r + 1, by the lemma either
2r | p − 1 or p | q 2 − 1. But 2r | p − 1 is impossible because

2r | p − 1 =⇒ p ≡ 1 (mod r) =⇒ 0 ≡ pq + 1 ≡ 2 (mod r)

and r > 2. So we must have p | q 2 − 1 = (q − 1)(q + 1). Since p is an odd prime and q − 1, q + 1 are
both even, we must have p | q−1 q+1 q+1
2 or p | 2 ; either way, p ≤ 2 < q. But then by a similar argument
we may conclude q < r, r < p, a contradiction.
Thus, at least one of p, q, r must equal 2. By a cyclic permutation we may assume that p = 2. Now
r | 2q + 1, so by the lemma, either 2q | r − 1 or r | 22 − 1. But 2q | r − 1 is impossible as before,
because q divides r2 + 1 = (r2 − 1) + 2 and q > 2. Hence, we must have r | 22 − 1. We conclude
that r = 3, and q | r2 + 1 = 10. Because q 6= p, we must have q = 5. Hence (2, 5, 3) and its cyclic
permutations are the only solutions.
8 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

13. Find all pairs of nonnegative integers (m, n) such that

(m + n − 5)2 = 9mn.

Solution: The equation is symmetric in m and n. The solutions are the unordered pairs
2 2
(5F2k , 5F2k+2 ), (L22k−1 , L22k+1 ),

where k is a nonnegative integer and { Fj }, { Lj } are the Fibonacci and Lucas sequences, respec-
tively — that is, the sequences defined by F1 = F2 = 1, L1 = 1, L2 = 3, and the recursive relations
Fj+2 = Fj+1 + Fj and Lj+2 = Lj+1 + Lj for j ≥ 1. Note that we amended the Lucas sequence by
considering L1 = −1 and L0 = 2.
Let g = gcd(m, n) and write m = gm1 and n = gn1 . Because 9mn is a perfect square, m1 and n1
are perfect squares. Let m1 = x2 and n1 = y 2 . The given condition becomes

(gx2 + gy 2 − 5)2 = 9g 2 x2 y 2 .

Taking the square root on both sides yields

g(x2 + y 2 ) − 5 = ±3gxy,

or
g(x2 + y 2 ± 3xy) = 5.

If g(x2 + y 2 + 3xy) = 5, then x2 + y 2 + 3xy ≤ 5, implying that x = y = g = 1 and (m, n) = (1, 1).
Otherwise, g(x2 + y 2 − 3xy) = 5 and g = 1 or 5. Fix g equal to one of these values, so that
5
x2 − 3xy + y 2 = . (1)
g

We call an unordered pair (a, b) a g-pair if (x, y) = (a, b) (or equivalently, (x, y) = (b, a)) satisfies (1)
and a and b are positive integers. Also, we call an unordered pair (p, q) smaller (respectively, larger)
than another unordered pair (r, s) if p + q is smaller (respectively, larger) than r + s.
Suppose that (a, b) is a g-pair. View (1) as a monic quadratic in x with y = b constant. The coefficient
of x in a monic quadratic function (x − r1 )(x − r2 ) equals −(r1 + r2 ), implying that (3b − a, b) should
also satisfy (1). Indeed,
5
b2 − 3b(3b − a) + (3b − a)2 = a2 − 3ab + b2 = .
g
Also, if b > 2, note that
5
a2 − 3ab + b2 = < b2 .
g
It follows that a2 − 3ab < 0 and so 3b − a > 0. Thus, if (a, b) is a g-pair with b > 2, then (b, 3b − a)
is a g-pair as well. Also note that for a0 = b and b0 = 3b − a, (b0 , 3b0 − a0 ) = (a, b).
Furthermore, if a ≥ b, note that a 6= b because otherwise −a2 = g > 0, which is impossible. Thus,
a > b and
5
a2 − 3ab + b2 = > b2 − a2 ,
g
Mathematics Olympiad Coachs Seminar, Zhuhai, China 9

which implies that a(2a − 3b) > 0 and hence a + b > b + (3b − a) and also 3b − a > b. Thus, (b, 3b − a)
is a smaller g-pair than (a, b) with b ≥ 3b − a.
Given any g-pair (a, b) with b ≤ a, if b ≤ 2 then a must equal r(g), where r(5) = 3 if r(1) = 4.
Otherwise, according to the above observation we can repeatedly reduce it to a smaller g-pair until
min(a, b) ≤ 2 — that is, to the g-pair (r(g), 1).
Beginning with (r(g), 1), we reverse the reducing process so that (x, y) is replaced by the larger g-pair
(3x − y, x). Moreover, this must generate all g-pairs since all g-pairs can be reduced to (r(g), 1). We
may express these possible pairs in terms of the Fibonacci and Lucas numbers; for g = 1, observe
that L2 = 1, L3 = 4 = r(1), and that

L2k+3 = L2k+2 + L2k+1 = (L2k+1 + L2k ) + L2k+1


= (L2k+1 + (L2k+1 − L2k−1 )) + L2k+1
= 3L2k+1 − L2k−1

for k ≥ 0. For g = 5, the Fibonacci numbers satisfy an analogous recursive relation, and F2 = 1,
F4 = 3 = r(5). Therefore, (m, n) = (L22k−1 , L22k+1 ) and (m, n) = (5F2k
2 , 5F 2
2k+2 ) for k ≥ 0.

14. Find in explicit form all ordered pairs of positive integers (m, n) such that mn − 1 divides m2 + n2 .

Solution: Half of the answers are

(m` , n` ) = (a1 r1`+1 + a2 r2`+1 , a1 r1` + a2 r2` ) for ` = 0, 1, 2, . . . ,

and
(m` , n` ) = (a2 r1`+1 + a1 r2`+1 , a2 r1` + a1 r2` ) for ` = 0, 1, 2, . . . ,
where
√ √
5+ 21 5 − 21
r1 = , r2 = ;
2√ 2 √
21 − 21 21 + 21
a1 = , a2 = .
42 42
The other half of the solutions are obtained by reversing the above solutions.
Assume that (m, n) satisfies the conditions of the problem. Then there is a positive integer k such
that
k(mn − 1) = m2 + n2 . (1)
It is clear that (m, n) 6= (1, 1). Without loss of generality we may assume that m ≥ n. Then m ≥ 2.
Note that m 6= n: otherwise we would have k(m2 − 1) = 2m2 , but 2 < 2m2 /(m2 − 1) < 3 for m ≥ 2.
Hence we may assume that m ≥ n + 1. We consider the quadratic equation

x2 − knx + n2 + k = 0. (2)

Let x1 and x2 be the two solutions of (2). Then x1 x2 = n2 + k and x1 + x2 = kn. By equation (1),
equation (2) has an integer root x1 = m. Hence equation (2) has another integer root x2 = kn − m =
(n2 +k)/m. Because m, n, k > 0, x2 > 0. We claim that x2 < n if n ≥ 2. Indeed, n−x2 = n+m−kn,
so

(mn − 1)(n − x2 ) = (mn − 1)(m + n) − n(m2 + n2 )


= mn2 − m − n − n3 .
10 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Therefore, x2 < n if and only if m(n2 − 1) − n3 − n > 0.


If m ≥ n + 2, then
m(n2 − 1) − n3 − n ≥ (n + 2)(n2 − 1) − n3 − n = 2(n2 − n − 1) > 0,
implying that x2 < n.
If n ≥ 3 and m = n + 1, then
m(n2 − 1) − n3 − n = n2 − 2n − 1 > 0,
implying that x2 < n.
13
If n = 2 and m = 3, then k = 5 is not an integer, a contradiction.
From the above argument, we conclude that if (m, n), m > n ≥ 2, is pair of integers satisfying the
conditions of the problem, then there is another pair of positive integers (m0 , n0 ) = (n, kn − m),
m > n = m0 > n0 , also satisfying the conditions of the problem, where
m2 + n2 (m0 )2 + (n0 )2
k= = .
mn − 1 m0 n 0 − 1
We can repeat this process if n0 ≥ 2. Hence to find all pairs of positive integers (m, n) satisfying the
conditions of the problem, we may start by assuming n = 1. Then
m2 + 1 2
k= =m+1+ ,
m−1 m−1
implying that (m − 1) divides 2, that is, m = 2 or m = 3. In either case, we obtain k = 5. Therefore
all solutions can be reduced to either (1, 2) or (1, 3) via the transformation (m, n) → (n, 5n−m). Now
we can reverse this process by applying the inverse transformation (x, y) → (5x − y, x) repeatedly,
starting with either (2, 1) or (3, 1), to generate all solutions. Furthermore, all solutions can be
expressed as consecutive terms (xk+1 , xk ) or (yk+1 , yk ) of the sequences {xk }∞ ∞
k=0 and {yk }k=0 , given
by
xk+2 = 5xk+1 − xk and yk+2 = 5yk+1 − yk ,
where x0 = 1, x1 = 2 and y0 = 1, y1 = 3. In either case, because the characteristic polynomial
of the sequence is x2 − 5x + 1, with roots r1 and r2 , there exist coefficients a1 , a2 , b1 , b2 such that
xk = a1 r1k + a2 r2k and yk = b1 r1k + b2 r2k . Solving for a1 , a2 and b1 , b2 using the initial values x0 , x1 and
y0 , y1 gives the desired answers.
15. Let A be a finite set of positive integers. Prove that there exists a finite set B of positive integers
such that A ⊆ B and Y X
x= x2 .
x∈B x∈B

Solution: For any finite set S of positive integers, let


Y X
D(S) = x− x2 .
x∈S x∈S

If D(A) = 0, then we take B = A. If D(A) < 0, then let m = max A. Write A0k = A ∪ { m + 1, m +
2, . . . , m + k }. Then there is a positive integer k such that
−D(A) < (m + 1)k − (k 3 + 2mk 2 + m2 k)
= (m + 1)k − k(m + k)2 ≤ D(A0k ) − D(A)
Mathematics Olympiad Coachs Seminar, Zhuhai, China 11

and hence D(A0k ) > 0. Thus, it suffices to find a finite set B containing A0 such that D(B) = 0,
because then B contains A as well. This reduces the problem to the next and final case.
nQ o
Assume that D(A) > 0, and write A0 = A. Define Ak+1 = Ak ∪ x∈Ak x − 1 recursively for
k = 0, 1, . . . , D(A) − 1. If D(Ak ) > 0, we have Ak 6= { 1} and hence
X Y Y
max Ak < x2 = x − D(Ak ) < x.
x∈Ak x∈Ak x∈Ak
Q
Therefore, x∈Ak x − 1 > max Ak and Ak+1 has one more element than Ak . It follows that
Y X
D(Ak+1 ) = x− x2
x∈Ak+1 x∈Ak+1
Y Y X Y
= x( x − 1) − x2 − ( x − 1)2
x∈Ak x∈Ak x∈Ak x∈Ak
Y X
= x− x2 − 1 = D(Ak ) − 1.
x∈Ak x∈Ak

Because D(A0 ) > 0, it follows that D(Ak ) = D(A) − k > 0 for k < D(A) and that D(AD(A) ) = 0.
Taking B = AD(A) completes the proof.

16. Let P (x) be a polynomial with integer coefficients. The integers a1 , a2 , . . . , an have the following
property: for any integer x there exists an 1 ≤ i ≤ n such that P (x) is divisible by ai . Prove that
there is an 1 ≤ i0 ≤ n such that ai0 divides P (x) for any integer x.

Solution: Assume that the claim is false. Then for each i = 1, 2, . . . , n there exists an integer
xi such that P (xi ) is not divisible by ai . Hence there is a prime power pki i which divides ai and does
not divide P (xi ). Some of powers of pki 1 , pk22 , . . . , pknn may have the same base. If so, ignore them all
but the one with the least exponent. To simplify the notation, assume the the sequence obtained
this way is pki 1 , pk22 , . . . , pkmm , m ≤ n and p1 , p2 , . . . , pm are distinct. Note that each ai is divisible by
some term of this sequence.
Since pki 1 , pk22 , . . . , pkmm are pairwise relative prime, the Chinese remainder theorem yields a solu-
tion of the simultaneous congruences

x ≡ x1 (mod pk11 ), x ≡ x2 (mod pk12 ), ..., x ≡ xm (mod pkmm ).


k k
Now since P (x) is an integer polynomial, x ≡ xi (mod pj j ) implies that P (x) ≡ P (xi ) (mod pj j ),
for each i = 1, 2, . . . , m. Then none of the numbers pki 1 , pk22 , . . . , pkmm divided P (x). But each ai is
k
divisible by pj j for some 1 ≤ j ≤ m, It follows that no ai divides P (x), a contradiction.

17. Determine (with proof) whether there is a subset X of the integers with the following property: for
any integer n there is exactly one solution of a + 2b = n with a, b ∈ X.

First Solution: Yes, there is such a subset. If the problem is restricted to the nonnegative
integers, it is clear that the set of integers whose representations in base 4 contains only the digits
0 and 1 satisfies the desired property. To accommodate thePnegative integers as well, we switch to
“base −4”. That is, we represent every integer in the form ki=0 ci (−4)i , with ci ∈ {0, 1, 2, 3} for all
i and ck 6= 0, and let X be the
12 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

set of numbers whose representations use only the digits 0 and 1. This X will again have the desired
property, once we show that every integer has a unique representation in this fashion.
To show base −4 representations are unique, let {ci } and {di } be two distinct finite sequences of
elements of {0, 1, 2, 3}, and let j be the smallest integer such that cj 6= dj . Then
k
X k
X
ci (−4)i 6≡ di (−4)i (mod 4j ),
i=0 i=0

so in particular the two numbers represented by {ci } and {di } are distinct. On the other hand, to
show that n admits a base −4 representation,
P2k find an integer k such that 1 + 42 + · · · + 42k ≥ n and
express n + 4 + · · · + 42k−1 i
as i=0 ci 4 . Now set d2i = c2i and d2i−1 = 3 − c2i−1 , and note that
P2k i
n = i=0 di (−4) .

Second Solution: For any S ⊂ Z, let S ∗ = {a + 2b| a, b ∈ S}. Call a finite set of integers
S = {a1 , a2 , . . . , am } ⊂ Z good if |S ∗ | = |S|2 , i.e., if the values ai + 2aj (1 ≤ i, j ≤ m) are distinct.
We first prove that given a good set and n ∈ Z, we can always find a good superset T of S such that
n ∈ T ∗ . If n ∈ S ∗ already, take T = S. Otherwise take T = S ∪ {k, n − 2k} where k is to be chosen.
Then put T ∗ = S ∗ ∪ Q ∪ R, where

Q = {3k, 3(n − 2k), k + 2(n − 2k), (n − 2k) + 2k}

and
R = {k + 2ai , (n − 2k) + 2ai , ai + 2k, ai + 2(n − 2k)| 1 ≤ i ≤ m}.
Note that for any choice of k, we have n = (n − 2k) + 2k ∈ Q ⊂ T ∗ . Except for n, the new values
are distinct nonconstant linear forms in k, so if k is sufficiently large, they will all be distinct from
each other and from the elements of S ∗ . This proves that T ∗ is good.
Starting with the good set X0 = {0}, we thus obtain a sequence of sets X1 , X2 , X3 , . . . such that for
each positive integer j, Xj is a good superset of Xj−1 and Xj∗ contains the jth term of the sequence
1, −1, 2, −2, 3, −3, . . . . It follows that

[
X= Xj
j=0

has the desired property.

18. Suppose the sequence of nonnegative integers a1 , a2 , . . . , a1997 satisfies

ai + aj ≤ ai+j ≤ ai + aj + 1

for all i, j ≥ 1 with i + j ≤ 1997. Show that there exists a real number x such that an = bnxc for all
1 ≤ n ≤ 1997.

Solution: Any x that lies in all of the half-open intervals


· ¶
an an + 1
In = , , n = 1, 2, . . . , 1997
n n
will have the desired property. Let
an ap an + 1 aq + 1
L= max = and U= min = .
1≤n≤1997 n p 1≤n≤1997 n q
Mathematics Olympiad Coachs Seminar, Zhuhai, China 13

We shall prove that


an am + 1
< ,
n m
or, equivalently,
man < n(am + 1) (∗)
for all m, n ranging from 1 to 1997. Then L < U , since L ≥ U implies that (∗) is violated when
n = p and m = q. Any point x in [L, U ) has the desired property.
We prove (∗) for all m, n ranging from 1 to 1997 by strong induction. The base case m = n = 1
is trivial. The induction step splits into three cases. If m = n, then (∗) certainly holds. If m > n,
then the induction hypothesis gives (m − n)an < n(am−n + 1), and adding n(am−n + an ) ≤ nam
yields (∗). If m < n, then the induction hypothesis yields man−m < (n − m)(am + 1), and adding
man ≤ m(am + an−m + 1) gives (∗).

19. Let p be a prime number, and let m and n be integers greater than 1. Suppose that mp(n−1) − 1 is
divisible by n. Show that mn−1 − 1 and n have a common divisor greater than 1.

Solution: For each prime divisor q of n, compute the exponent of p in the prime factorization
of q − 1, and let q0 be a prime for which this quantity is minimized. Let k be the exponent of p
in the prime factorization of q0 − 1; then n ≡ 1 (mod pk ) and q0 6≡ 1 (mod pk+1 ). In particular,
the greatest common divisor of p(n − 1) and q0 − 1 is divisible by pk but not by pk+1 , and so also
divides n − 1. Therefore, there exist integers r and s so that rp(n − 1) + s(q0 − 1) = n − 1; since
mp(n−1) ≡ mq0 −1 ≡ 1 (mod q0 ), we deduce mn−1 ≡ 1 (mod q0 ). We conclude that mn−1 − 1 and n
have the common factor q0 .

Note: This problem generalizes a problem from MOP 1997: show that 2n−1 ≡ −1 (mod n) for n
a positive integer only if n = 1. (Set m = p = 2 in the current problem to recover this conclusion.)

20. Starting from a triple (a, b, c) of nonnegative integers, a move consists of choosing two of them, say
x and y, and replacing one of these by either x + y or |x − y|. For example, one can go from (3, 5, 7)
to (3, 5, 4) in one move. Prove that there exists a constant r > 0 such that whenever a, b, c, n are
positive integers with a, b, c < 2n , there is a sequence of at most rn moves transforming (a, b, c) into
(a0 , b0 , c0 ) with a0 b0 c0 = 0.

Solution: We will use strong induction on n to show that r = 12 works. The bases is trivial.
Without loss of generality, we assume that a ≤ b ≤ c. Using two moves if necessary to replace a by
c − a and b by c − b, we may instead assume that 0 ≤ a ≤ b ≤ c/2. let m be the integer such that
2m−1 ≤ b < 2m . Since 1 ≤ b ≤ c/2 < 2n−1 , we have 1 ≤ m ≤ n − 1. Define a sequence x0 = a, x1 = b,
and xk = xk−1 + xk−2 for k ≥ 2.

Lemma Every integer y ≥ b can be expressed in the form

² + xii + · · · + xi`

where 0 ≤ ² < b and i1 < i2 < · · · < i` and xi` ≤ y < xi` +1 .

Proof: Since xi are increasing, there is a unique i ≥ 1 for which xi ≤ y < xi+1 . We use strong
induction on i. If y − xi < b, we let ² = y − xi and we are done. Otherwise x1 = b ≤ y − xi <
14 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

xi+1 − xi = xi−1 so there is a unique j ≥ 1 such that xi ≤ y − xi < xj+1 , and j < i, so we finish by
applying the inductive hypothesis to y − xi .
Write c = ² + xi1 + · · · + xi` , where 0 ≤ ² < b and 0 < i1 < · · · < i` . Since xk+2 = xk+1 + xk =
2xk + xk−1 ≥ 2xk for k ≥ 1, we have

x2n−2m+3 ≥ 2n−m+1 x1 ≥ 2n−m+1 2m−1 = 2n > c,

so i1 < i2 < · · · < i` < 2n − 2m + 3.


Using 2n − 2m + 1 addition moves we can change (a, b, c) = (x0 , x1 , c) into (x2 , x1 , c), then into
(x2 , x3 , c), and so on, until we reach (x2n−2m+2 , x2n−2m+1 , c). If instead intersperse at most 2n−2m+2
moves between these to subtract from c the xij in the representation of c as they produced in the
first two coordinates, we will eventually reduce c to ². Now we can perform 2n − 2m + 1 substraction
moves to change (x2n−2m+2 , x2n−2m+1 back to (x2n−2m , x2n−2m+1 ), and so on, undoing the previous
operations on the first two coordinates, until we end up with the triple a, b, ²).
Reaching (a, b, ²) required at most

2 + (2n − 2m + 1) + (2n − 2m + 2) + (2n − 2m + 1) = 6n − 6m + 6

moves. Afterwards, since a, b, ² < 2m , we can transform (a, b, c) into a triple with a zero in at most
12m more moves, by the inductive hypothesis, for a total of (6n − 6m + 6) + 12m = 6n + 6m + 6, 12m
moves, since m ≤ n − 1.

21. Let S be a set of integers (not necessarily positive) such that

(a) there exist a, b ∈ S with gcd(a, b) = gcd(a − 2, b − 2) = 1;


(b) if x and y are elements of S (possibly equal), then x2 − y also belongs to S.

Prove that S is the set of all integers.

First Solution: In the solution below we use the expression S is stable under x 7→ f (x) to
mean that if t belongs to S, then f (t) also belongs to S. If c, d ∈ S, then by condition (b), S is
stable under x 7→ c2 − x and x 7→ d2 − x. Hence, it is stable under x 7→ c2 − (d2 − x) = x + (c2 − d2 ).
Similarly, S is stable under x 7→ x + (d2 − c2 ). Hence, S is stable under x 7→ x + n and x 7→ x − n,
whenever n is an integer linear combination of finitely many numbers in T = { c2 − d2 | c, d ∈ S }.
By condition (a), S 6= ∅ and hence T 6= ∅ as well. For the sake of contradiction, assume that some
p divides every element in T. Then c2 − d2 ≡ 0 (mod p) for all c, d ∈ S. In other words, for each
c, d ∈ S, either d ≡ c (mod p) or d ≡ −c (mod p). Given c ∈ S, c2 − c ∈ S, by condition (b), so
c2 − c ≡ c (mod p) or c2 − c ≡ −c (mod p). Hence,

c ≡ 0 (mod p) or c ≡ 2 (mod p) (∗)

for each c ∈ S. By condition (a), there exist some a and b in S such that gcd(a, b) = 1, that is, at
least one of a or b cannot be divisible by p. Denote such an element of S by α; thus, α 6≡ 0 (mod p).
Similarly, by condition (a), gcd(a − 2, b − 2) = 1, so p cannot divide both a − 2 and b − 2. Thus, there
is an element of S, call it β, such that β 6≡ 2 (mod p). By (∗), α ≡ 2 (mod p) and β ≡ 0 (mod p).
By condition (b), β 2 − α ∈ S. Taking c = β 2 − α in (∗) yields either −2 ≡ 0 (mod p) or −2 ≡ 2
(mod p), so p = 2. Now (∗) says that all elements of S are even, contradicting condition (a). Hence,
our assumption is false and no prime divides every element in T.
Mathematics Olympiad Coachs Seminar, Zhuhai, China 15

It follows that T 6= { 0}. Let x be an arbitrary nonzero element of T. For each prime divisor of x,
there exists an element in T which is not divisible by that prime. The set A consisting of x and each
of these elements is finite. By construction, m = gcd{ y | y ∈ A } = 1, and m can be written as
an integer linear combination of finitely many elements in A and hence in T. Therefore, S is stable
under x 7→ x + 1 and x 7→ x − 1. Because S is nonempty, it follows that S is the set of all integers.

Second Solution: Define T, a, and b as in the first solution. We present another proof that
no prime divides every element in T. Suppose, for sake of contradiction, that such a prime p does
exist. By condition (b), a2 − a, b2 − b ∈ S. Therefore, p divides a2 − b2 , x1 = (a2 − a)2 − a2 , and
x2 = (b2 − b)2 − b2 . Because gcd(a, b) = 1, both gcd(a2 − b2 , a3 ) and gcd(a2 − b2 , b3 ) equal 1, so p does
not divide a3 or b3 . But p does divide x1 = a3 (a − 2) and x2 = b3 (b − 2), so it must divide a − 2 and
b − 2. Because gcd(a − 2, b − 2) = 1 by condition (a), this implies p | 1, a contradiction. Therefore
our original assumption was false, and no such p exists.

22. For a set S, let |S| denote the number of elements in S. Let A be a set of positive integers with
|A| = 2001. Prove that there exists a set B such that

(i) B ⊆ A;
(ii) |B| ≥ 668;
(iii) for any u, v ∈ B (not necessarily distinct), u + v 6∈ B.

First Solution: (By Reid Barton) For a positive integer n, let Zn denote the set of residues
modulo n. Let φ(n) be the Euler function which is defined to be the number of integers between
1 and n relatively prime to n. Call a set A of residues modolo 3n sum-free if for any a, b ∈ A, a + b
is not (congruent to) an element of A.
Lemma. For any n ≥ 1, there exist 3n − 1 sum-free sets of 3n−1 residues modulo 3n such that
every nonzero residue modulo 3n appears in exactly 3n−1 of the subsets.
Proof: We construct the desired subsets inductively. For n = 1 we take the sets { 1} and { 2}.
Let n ≥ 1, and suppose that the statement holds for n, that is, we have 3n − 1 sum-free subsets A1 ,
A2 , . . . , A3n −1 of Z3n such that every element of Z3n belongs to exactly 3n−1 of the Ai . Construct
sets B1 , B2 , . . . , B3n −1 by

Bi = { x ∈ Z3n+1 kx ≡ m0 (mod 3)n , m0 ∈ Ai }.

Then each Bi contains 3|Ai | = 3n residues, and the Bi are sum-free, because if a, b ∈ Bi , (a+b) mod 3n
is not in Ai so a + b is not in Bi . Moreover, each element x of Z3n+1 which is not 0 modulo 3n (i.e.,
all elements except 0, 3n , 2 · 3n ) is in exactly 3n−1 of the Bi , namely those corresponding to the Ai
containing x mod 3n .
Now define sets
C = { 3n , 3n + 1, . . . , 2 · 3n − 1 }
and
U = { x ∈ Z3n+1 k gcd(x, 3) = 1 }.
Then C ⊂ Z3n+1 , |C| = 3n . Note that C is sum-free, because if a, b ∈ C with 3n ≤ a, b < 2 · 3n then
2 · 3n ≤ a + b < 4 · 3n so a + b is not congruent modulo 3n+1 to an element of C. For each y ∈ U , let
Cy = yC = { yxkx ∈ C }. Then Cy is also sum-free for every y ∈ U , because if we had ya and yb in
16 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Cy with ya + yb ∈ Cy , then a and b would be elements of C summing to an element of C. Also, every


Cy contains |C| = 3n residues because multiplication by y is invertible. Since |U | = φ(3n+1 ) = 2 × 3n ,
there are 2 · 3n of sets Cy ’s.
Consider the sets

B1 , B2 , . . . , B3n −1 , C1 , C2 , C4 , C5 , C7 , . . . , C3n+1 −2 , C3n+1 −1 .

There are 3n − 1 + 2 · 3n = 3n+1 − 1 of these sets, so it suffices to check that every nonzero residue
modulo 3n+1 appears in exactly 3n of them. Let m be a nonzero residue modulo 3n+1 , and write
m = 3k s, 0 ≤ k ≤ n, gcd(s, 3) = 1. We consider two cases.

(i) k < n. Then m is a nonzero residue modulo 3n , so m is contained in exactly 3n−1 of the
sets Bi , namely those which correspond to Ai with m0 ∈ Ai (where m ≡ m0 (mod 3)n ). The
number of sets Ci containing m is the number of solutions to y −1 m ∈ C with y ∈ U , or the
number of z ∈ U such that zm ∈ C. Since m 6= 0, as z ranges over Z3n+1 , one third of the
residues zm are in C; likewise, since 3m 6= 0, one third of the residues 3zm are in C. Since
U = Z3n+1 \ 3Z3n+1 , zm ∈ C for one third of the values z ∈ U . So m is in one third of the sets
Cy , giving 31 |U | = 2 · 3n−1 more sets containing m. The total number of sets containing m is
then 3n−1 + 2 · 3n−1 = 3n .
(ii) k = n. Then m = 3n or 2 · 3n (s = 1 or 2 respectively). Then m mod 3n = 0, so m does not
appear in any of the sets Ai . However, m appears in every set Cy with y ≡ s (mod 3), so m
appears in 3n of the Cy . Thus the total number of sets containing m is again 3n .

Thus the sets { Bi }, { Cy } have the desired properties and the Lemma holds by induction.
Now let 3n be a power of 3 larger than the sum of any two elements of A. By the Lemma, there
exist 3n − 1 sets S1 , . . . , S3n −1 of 3n−1 residues modulo 3n such that every nonzero residue modulo
3n appears in exactly 3n−1 of the Si . Let ni be the number of elements of A contained in Si . Since
every element of A appears 3n−1 times,
n −1
3X
ni = 3n−1 |A|
i=1

so some ni is at least
3n−1 |A| 1 2001
> |A| = = 667.
3n − 1 3 3
Let B be the set of elements of A contained in Si . Then |B| ≥ 668, and if u, v ∈ B, then u + v ∈
/ B,
because Si is sum-free. Thus the set B has the desired properties.

Second Solution: Let the elements of A be a1 , . . . , a2001 . Let p be a prime number such that
p ≡ 2 (mod 3) and p is larger than all the ai . Such a prime p exists by Dirichlet’s Theorem,
although the result can also be easily proven directly. There is at least one prime congruent to 2
modulo 3 (namely, 2). Suppose there were only finitely many primes congruent to 2 modulo 3, and
let their product be P . Then 3P − 1, which is larger than P and congruent to 2 modulo 3, must
have another prime divisor congruent to 2 modulo 3, contradiction. Thus, the original assumption
was wrong, and there are infinitely many odd primes that are congruent to 2 modulo 3. Specifically,
one such prime is larger than all ai .
Mathematics Olympiad Coachs Seminar, Zhuhai, China 17

All elements of S are distinct and nonzero modulo p. Call a number n mediocre if the least positive
residue of n modulo p lies in [(p + 1)/3, (2p − 1)/3]. For any 1 ≤ i ≤ 2001, there are exactly (p + 1)/3
integer values of k ∈ [1, p − 1] such that kai is mediocre. Thus, there are
2001(p + 1)
= 667(p + 1)
3
pairs of (k, i) such that kai is mediocre. By the Pigeonhole Principle, there exists some k for
which the set
B = { ai | kai is mediocre }
has at least 668 elements.
We now claim that this B satisfies the desired properties. It suffices to show that k times the sum
of any two elements of B is not mediocre and hence cannot equal k times any element of B. To
that end, note that k times the sum of any two elements of B cannot be mediocre because it is
congruent modulo p to some number in [2(p + 1)/3, 2(2p − 1)/3] or, equivalently, to some number in
[0, (p − 2)/3] ∪ [(2p + 2)/3, p − 1], which is a set containing no mediocre numbers. Thus, the set B
satisfies the desired properties.

23. For a given prime p, find the greatest positive integer n with the following property: the edges of the
complete graph on n vertices can be colored with p + 1 colors so that:

(a) at least two edges have different colors;


(b) if A, B, and C are any three vertices and the edges AB and AC are of the same color, then BC
has the same color as well.

Solution: Let n be a number having the given property, and let edges of the complete graph
with n vertices be colored in p + 1 colors denoted 1, 2, . . . , p + 1 so that the given conditions hold.
Consider an arbitrary vertex A1 . Denote by xi the number of edges with endpoint A1 colored in the
color i. Then, of course,
x1 + x2 + · · · + xp+1 = n − 1. (1)
Invoking the Pigeonhole principle, we are going to show that

xi ≤ p − 1 for each i = 1, 2, . . . p + 1. (2)

Assume (2) is not true. Without loss of generality, let the edges A1 A2 , A1 A3 , . . . A1 Ap+1 be of the
ith color. Then, according (b), each of he edges Ak A` , 2 ≤ k < ` ≤ p + 1, is of the ith color as well.
Take any vertex B of the graph. At least one of the p + 1 edges BA1 , BA2 , . . . , BAp+1 is of the ith
color: otherwise, one of the other p colors would double up, making two edges BAk and BA` both
the same color m 6= i. But then (b) imply that Ak A` is of the mth color, a contradiction.
Thus the edge BAj is of the ith color for some j = 1, 2, . . . , p + 1. Then since BAj and Aj Ak are of
color i, it follows that BAk is also in color i, and this is true for all k = 1, 2, . . . , p + 1. The vertex B
was chosen arbitrarily, so the same result applies to any other vertex C. Then using (b) for the last
time, we obtain that any edge BC is of the ith color, and this contradicts (a).
Thus we proved (2) which, combined with (1), gives

n − 1 = x1 + x2 + · · · + xp+1 ≤ (p + 1)(p − 1) = p2 − 1.

This means n ≤ p2 . Note that this conclusion holds regardless of whether or not p is a prime.
18 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

The Pigeonhole principle did its job. Now we have to point out an example proving that the edges
of the complete graph G with p2 vertices can be colored in p + 1 colors so that (a) and (b) hold.
The construction is indeed a very nice one. Regard the vertices of G as ordered pairs (i, j) where
0 ≤ i, j ≤ p−1. Let A1 = (a1 , b1 ) and A2 = (a2 , b2 ) be vertices of G. if b1 6= b2 , then gcd(b1 −b2 , p) = 1
as p is a prime. Then the congruence

(b1 − b2 )x = a1 − a2 (mod p)

has a unique solution x = i in the set {0, 1, 2, . . . , p − 1}. In this case, color edges A1 A2 with color
i + 1. If b1 = b2 , then color this edge with color p + 1. Thus the edges of G are colored with p + 1
edges. The condition (a) holds for trivial reasons, and (b) follows from the transitive property of
congruence.
Hence the greatest number with the desired property is p2 .
24. Let p > 2 be a prime and let a, b, c, d be integers not divisible by p, such that

{ra/p} + {rb/p} + {rc/p} + {rd/p} = 2

for any integer r not divisible by p. Prove that at least two of the numbers a + b, a + c, a + d, b + c,
b + d, c + d are divisible by p. (Note: {x} = x − bxc denotes the fractional part of x.)

Solution: For convenience, we write [x] for the unique integer in {0, . . . , p − 1} congruent to
x modulo p. In this notation, the given condition can be written

[ra] + [rb] + [rc] + [rd] = 2p for all r not divisible by p. (1)

The conditions of the problem are preserved by replacing a, b, c, d with ma, mb, mc, md for any integer
m relatively prime to p. If we choose m so that ma ≡ 1 (mod p) and then replace a, b, c, d with
[ma], [mb], [mc], [md], respectively, we end up in the case a = 1 and b, c, d ∈ {1, . . . , p − 1}. Applying
(1) with r = 1, we see moreover that a + b + c + d = 2p.
Now observe that ½
[x] [rx] < p − [x]
[(r + 1)x] − [rx] =
−p + [x] [rx] ≥ p − [x].
Comparing (1) applied to two consecutive values of r and using the observation, we see that for each
r = 1, . . . , p − 2, two of the quantities

p − a − [ra], p − b − [rb], p − c − [rc], p − d − [rd]

are positive and two are negative. We say that a pair (r, x) is positive if [rx] < p − [x] and negative
otherwise; then for each r < p − 1, (r, 1) is positive, so exactly one of (r, b), (r, c), (r, d) is also positive.
Lemma If r1 , r2 , x ∈ {1, . . . , p − 1} have the property that (r1 , x) and (r2 , x) are negative but (r, x)
is positive for all r1 < r < r2 , then
jpk jpk
r2 − r1 = or r2 − r1 = + 1.
x x

Proof: Note that (r0 , x) is negative if and only if {r0 x + 1, r0 x + 2, . . . , (r0 + 1)x} contains a multiple
of p. In particular, exactly one multiple of p lies in {r1 x, r1 x + 1, . . . , r2 x}. Because [r1 x] and [r2 x]
are distinct elements of {p − [x], . . . , p − 1}, we have

p − x + 1 < r2 x − r1 x < p + x − 1,
Mathematics Olympiad Coachs Seminar, Zhuhai, China 19

from which the lemma follows.

[rx] 9 10 0 1 2 3 4 5 6 7 8 9 10 0
is (r, x) + or –? − + + + −
r 3 4 5 6 7

(The above diagram illustrates the meanings of positive and negative in the case x = 3 and p = 11. Note that
the difference between 7 and 3 here is b xp c + 1. The next r such that (r, x) is negative is r = 10; 10 − 7 = b xp c.)
Recall that exactly one of (1, b), (1, c), (1, d) is positive; we may as well assume (1, b) is positive,
which is to say b < p2 and c, d > p2 . Put s1 = b pb c, so that s1 is the smallest positive integer such
that (s1 , b) is negative. Then exactly one of (s1 , c) and (s1 , d) is positive, say the former. Because s1
is also the smallest positive integer such that (s1 , c) is positive, or equivalently such that (s1 , p − c)
p
is negative, we have s1 = b p−c c. The lemma states that consecutive values of r for which (r, b) is
negative differ by either s1 or s1 + 1. It also states (when applied with x = p − c) that consecutive
values of r for which (r, c) is positive differ by either s1 or s1 + 1. From these observations we will
show that (r, d) is always negative.

?
r 1 s1 s1 + 1 s0 s0 + 1 s s+1=t
(r, b) + − + − + − −?
(r, c) − ... + − ... + − ... − +?
(r, d) − − − − − + −?

Indeed, if this were not the case, there would exist a smallest positive integer s > s1 such that (s, d)
is positive; then (s, b) and (s, c) are both negative. If s0 is the last integer before s such that (s0 , b) is
negative (possibly equal to s1 ), then (s0 , d) is negative as well (by the minimal definition of s). Also,

s − s0 = s1 or s − s0 = s1 + 1.

Likewise, if t were the next integer after s0 such that (t, c) were positive, then

t − s0 = s1 or t − s0 = s1 + 1.

From these we deduce that |t − s| ≤ 1. However, we can’t have t 6= s because then both (s, b) and
(t, b) would be negative — and any two values of r for which (r, b) is negative differ by at least
s1 ≥ 2, a contradiction. (The above diagram shows the hypothetical case when t = s + 1.) Nor can
we have t = s because we already assumed that (s, c) is negative. Therefore we can’t have |t − s| ≤ 1,
contradicting our findings and thus proving that (r, d) is indeed always negative.
Now if d 6= p − 1, then the unique s ∈ {1, . . . , p − 1} such that [ds] = 1 is not equal to p − 1; and
(s, d) is positive, a contradiction. Thus d = p − 1 and a + d and b + c are divisible by p, as desired.

25. For real number x, let dxe denote the smallest integer greater than or equal to x, let bxc denote the
greatest integer less than or equal to x, and let {x} denote the fractional part of x, which is given
by x − bxc. Let p be a prime number. For integers r, s such that rs(r2 − s2 ) is not divisible by p, let
f (r, s) denote the number of integers n ∈ {1, 2, . . . , p − 1} such that {rn/p} and {sn/p} are either
both less than 1/2 or both greater than 1/2. Prove that there exists N > 0 such that for p ≥ N and
all r, s, » ¼ ¹ º
p−1 2(p − 1)
≤ f (r, s) ≤ .
3 3
20 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

Solution: We assume that p is sufficiently large. Since f (r, s) = f (br, bs) for any b not divisible by
p, we may assume r = 1 and simply write f (s) instead of f (r, s). Also notice that f (s) = p−1−f (−s),
so we may assume 1 ≤ s ≤ (p − 1)/2. Moreover, s = 1 is forbidden, f (2) = (p − 1)/2 or (p − 3)/2,
and one easily checks that f (3) = b2(p − 1)/3c. So we may assume s ≥ 4.
Let g1 (s) be the number of a ∈ {1, . . . , (p − 1)/2} such that {as/p} < 1/2; and let g2 (s) be the
number of a ∈ {(p + 1)/2, . . . , p − 1} such that {as/p} > 1/2. Note that

{as/p} + {(p − a)s/p} = 1.

Thus g1 (s) = g2 (s) = f (s)/2. We consider two cases.

(a) s ∈ [4, p/4]. Note that


¯ ¯ ¯ µ ¶¯
¯ ¯ ¯ ¯
¯f (s) − p − 1 ¯ = ¯g1 (s) − p − 1 − g1 (s) ¯ ≤ s + p .
¯ 2 ¯ ¯ 2 ¯ 2 2s

To see this, divide s, 2s, . . . , (p−1)s/2 into groups depending on which of the intervals (0, p), (p, 2p), . . .
they fall into. In each group except the last one, at most one more number falls into one half
of the interval than into the other half. Since the largest of these numbers is less than sp/2,
the number of such groups is at most s/2. In the last group, the maximum discrepancy is the
greatest quantity of the numbers that fit into one half of the interval, which is at most p/2s.
For s ∈ [4, p/4], the right side of the above inequality achieves its maximum value at the
endpoints of the interval. Thus we get the upper bound
¯ ¯
¯ ¯
¯f (r, s) − p − 1 ¯ ≤ 2 + p
¯ 2 ¯ 8
and the right side is less than (p − 1)/6 for p sufficiently large.
(b) s ∈ ((p − 1)/4, (p − 1)/2]. In this case, there cannot exist three consecutive values of a ∈
{1, . . . , (p − 1)/2} or three consecutive values of a ∈ {(p + 1)/2, . . . , p − 1} such that the three
values of {as/p} all lie in a single interval of length 1/2. For p ≡ 1 (mod 6) this implies
d(p − 1)/3e ≤ f (s) ≤ b2(p − 1)/3c; for p ≡ 5 (mod 6), the lower bound is true. To violate the
upper bound, f (s) ≥ 4k + 3 where p = 6k + 5. Since f (s) = 2g2 (s), g2 (s) ≥ 2k + 2. But we can
regroup 3k + 2 numbers {1, 2, . . . , (p − 1)/2} as

{(1, 2), (3, 4, 5), . . . , (3k, 3k + 1, 3k + 2)} .


| {z }
k+1 groups

From the earlier observation, each group can provide at most two a’s such that {as/p} < 1/2.
Hence {s/p}, {2s/p} < 1/2. Since 1 ≤ s ≤ (p − 1)/2, {2s/p} = 2s/p. But then s/p < 1/4 and
4s < p. Now p > 4s > p − 1, which is impossible for integers s and p.

Note: Paul Valiant noted that one can alternatively treat the case s > (p − 1)/4 by a more
careful analysis of the group sizes, particularly in the neighborhood of (p − 1)/3.
The assertion of the problem holds in fact for all p ≥ 5 (note that the assertion is vacuous for p = 2, 3);
furthermore, equality holds if and only if r ≡ ±3s (mod p) or s ≡ ±3r (mod p).
The result is the main step in the solution of the following problem, posed recently by Greg Martin.
Fix a prime number p. I choose 3 integers a1 , a2 , a3 not divisible by p and no two congruent modulo
Mathematics Olympiad Coachs Seminar, Zhuhai, China 21

p. You then choose an integer r not divisible by p, and then collect from me a number of dollars
equal to the smallest positive integer congruent to one of ra1 , ra2 , ra3 modulo p. What is the smallest
amount I will have to pay out, and how do I achieve this minimum? (The corresponding question
for k integers instead of 3 is open, and the proposer offers $15 for its solution.)

26. Is it possible to select 102 17-element subsets of a 102-element set, such that the intersection of any
two of the subsets has at most 3 elements?

Solution: The answer is “yes.” More generally, suppose that p is a prime congruent to 2 modulo
3. We show that it is possible to select p(p + 1)/3 p-element subsets of a p(p + 1)/3-element set, such
that the intersection of any two of the subsets has at most 3 elements. Setting p = 17 yields the
claim.
Let P be the projective plane of order p (which this solution refers to as “the projective plane,” for
short), defined as follows. Let A be the ordered triples (a, b, c) of integers modulo p, and define the
equivalence relation ∼ by (a, b, c) ∼ (d, e, f ) if and only if (a, b, c) = (dκ, eκ, f κ) for some κ. Then
let P = (A − {(0, 0, 0)}) / ∼. We let [a, b, c] ∈ P denote the equivalence class containing (a, b, c), and
we call it a point of P. Because A − {(0, 0, 0)} contains p3 − 1 elements, and each equivalence class
under ∼ contains p − 1 elements, we find that |P| = (p3 − 1)/(p − 1) = p2 + p + 1.
Given q ∈ P, we may write q = [α, β, γ] and consider the solutions [x, y, z] to

αx + βy + γz ≡ 0 (mod p).

The set of these solutions is called a line in the projective plane; it is easy to check that this line is
well-defined regardless of how we write q = [α, β, γ], and that (x, y, z) satisfies the above equation if
and only if every triple in [x, y, z] does. We let [[α, β, γ]] denote the above line.
It is easy to check that P is in one-to-one correspondence with P ∗ , the set of lines in the projective
plane, via the correspondence [α, β, γ] ←→ [[α, β, γ]]. It is also easy to check that any two distinct
points lie on exactly one line, and that any two distinct lines intersect at exactly one point. Fur-
thermore, any line contains exactly p + 1 points. (The projective plane is not an invention of this
solution, but a standard object in algebraic geometry; the properties described up to this point are
also well known.)
Define ϕ : P → P by ϕ([a, b, c]) = [b, c, a]. Given a point q ∈ P, we say we rotate it to obtain q 0 if
q 0 = ϕ(q). Similarly, given a subset T ⊆ P, we say we rotate it to obtain T 0 if T 0 = ϕ(T ).
Given a point q 6= [1, 1, 1] in the projective plane, we rotate it once and then a second time to obtain
two additional points. Together, these three points form a triplet. We will show below that (i) the
corresponding triplet actually contains three points. Observe that any two triplets obtained in this
manner are either identical or disjoint. Because there are p2 + p points in P − {[1, 1, 1]}, it follows
that there are p(p + 1)/3 distinct triplets. Let S be the set of these triplets.
Given a line ` = [[α, β, γ]] 6= [[1, 1, 1]] in the projective plane, it is easy to show that rotating it once
and then a second time yields the lines [[β, γ, α]] and [[γ, α, β]]. The points q 6= [1, 1, 1] on [[α, β, γ]],
[[β, γ, α]], and [[γ, α, β]] can be partitioned into triplets. More specifically, we will show below that
(ii) there are exactly 3p such points q 6= [1, 1, 1]. Hence, these points can be partitioned into exactly
p distinct triplets; let T` be the set of such triplets.
Take any two lines `1 , `01 6= [[1, 1, 1]], and suppose that |T`1 ∩ T`01 | > 3. We claim that `1 and `01 are
rotations of each other. Suppose otherwise for sake of contradiction. Let `2 , `3 be the rotations of `1 ,
and let `02 , `03 be the rotations of `01 . We are given that T`1 and T`01 share more than three triplets;
22 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA

that is, `1 ∪ `2 ∪ `3 intersects `01 ∪ `02 ∪ `03 in more than 9 points. Because `1 and `01 are not rotations
of each other, each `i is distinct from all the `0j . Hence, `i ∩ `0j contains exactly one point for each i
and j. It follows that `1 ∪ `2 ∪ `3 and `01 ∪ `02 ∪ `03 consists of at most 3 · 3 = 9 points, a contradiction.
Hence, our assumption as wrong, and |T`1 ∩ T`01 | > 3 only if `1 and `01 are rotations of each other.
Just as there are p(p + 1) points in P − {[1, 1, 1]}, there are p(p + 1) lines in P ∗ − {[[1, 1, 1]]}. We can
partition these into p(p + 1)/3 triples (`1 , `2 , `3 ), where the lines in each triple are rotations of each
other. Now, pick one line ` from each triple and take the corresponding set T` of triplets. From the
previous paragraph, any two of these p(p + 1)/3 sets intersect in at most 3 triplets.
Hence, we have found a set S of p(p + 1)/3 elements (namely, the triplets of P), along with p(p + 1)/3
subsets of S (namely, the appropriate T` ) such that no two of these subsets have four elements in
common. This completes the proof.
Well, not quite. We have yet to prove that (i) if q 6= [1, 1, 1], then the triplet {q, ϕ(q), ϕ2 (q)} contains
three distinct points, and (ii) if `1 = [[α, β, γ]] 6= [[1, 1, 1]], then there are 3p points q 6= [1, 1, 1] on
[[α, β, γ]] ∪ [[β, γ, α]] ∪ [[γ, α, β]].
To prove (i), we first show that x3 ≡ 1 (mod p) only if x ≡ 1 (mod p). Because 3 is coprime to p − 1,
we can write 1 = 3r + (p − 1)s. We are given that x3 ≡ 1 (mod p), and by Fermat’s Little Theorem
we also have xp−1 ≡ 1 (mod p). Hence,
¡ ¢r ¡ p−1 ¢s
x = x3r+(p−1)s = x3 x ≡ 1r · 1s ≡ 1 (mod p).
(Alternatively, let g be a primitive element modulo p, and write x = g m for some nonnegative integer
m. Then
1 ≡ (g m )3 = g 3m (mod p),
implying that p − 1 divides 3m. Because p − 1 is relatively prime to 3, we must have (p − 1) | m.
Writing m = (p − 1)n, we have x ≡ g m ≡ (g p−1 )n ≡ 1 (mod p).)
Now, if q = [a, b, c] 6= [1, 1, 1], then suppose (for sake of contradiction) that [a, b, c] = [b, c, a]. There
exists κ such that (a, b, c) = (bκ, cκ, aκ). Thus,
ab−1 ≡ bc−1 ≡ ca−1 (mod p),
because all three quantities are congruent to κ modulo p. Hence, (ab−1 )3 ≡ (ab−1 )(bc−1 )(ca−1 ) ≡
1 (mod p). From this and the result in the last paragraph, we conclude that ab−1 ≡ 1 (mod p). There-
fore, a ≡ b (mod p), and similarly b ≡ c (mod p) — implying that [a, b, c] = [1, 1, 1], a contradiction.
Next, we prove (ii). Let `1 = [[α, β, γ]] 6= [[1, 1, 1]], `2 = [[β, γ, α]], and `3 = [[γ, α, β]]. Because
[[α, β, γ]] 6= [[1, 1, 1]], we know (from a proof similar to that in the previous paragraph) that `1 , `2 , `3
are pairwise distinct. Hence, any two of these lines intersect at exactly one point. We consider two
cases: `1 and `2 intersect at [1, 1, 1], or they intersect elsewhere.
If [1, 1, 1] lies on `1 and `2 , then it lies on `3 as well. Each line contains p + 1 points in total and
hence p points distinct from [1, 1, 1]. Counting over all three lines, we find 3p points distinct from
[1, 1, 1]; these points must be distinct from each other, because any two of the lines `i , `j intersect at
only [1, 1, 1].
If instead q0 = `1 ∩ `2 is not equal to [1, 1, 1], then [1, 1, 1] cannot lie on any of the lines `1 , `2 , `3 .
We have ϕ(q0 ) = `2 ∩ `3 and ϕ2 (q0 ) = `3 ∩ `1 ; because q0 6= [1, 1, 1], the three intersection points
q0 , ϕ(q0 ), ϕ2 (q0 ) are pairwise distinct. Now, each of the three lines `1 , `2 , `3 contains p + 1 points (all
distinct from [1, 1, 1]), for a total of 3p + 3 points. However, we count each of q0 , ϕ(q0 ), ϕ2 (q0 ) twice
in this manner, so in fact we have (3p + 3) − 3 = 3p points on `1 ∪ `2 ∪ `3 − {[1, 1, 1]}, as desired.
This completes the proof.

You might also like