100% found this document useful (1 vote)
439 views22 pages

Zuming Feng Number Theory Mathematics Olympiad Coachs Seminar Coachnums Some Solutions 2004 22p

1. The document contains 9 multi-part math problems and their solutions related to number theory. 2. The solutions use techniques like induction, prime factorization, and modular arithmetic to prove various properties about sums, sequences, and divisibility. 3. One problem proves that the sum of differences between paired integers ends in 9, while another shows any rational number in a prime-defined sequence will eventually reach 0.

Uploaded by

Emerson Soriano
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
439 views22 pages

Zuming Feng Number Theory Mathematics Olympiad Coachs Seminar Coachnums Some Solutions 2004 22p

1. The document contains 9 multi-part math problems and their solutions related to number theory. 2. The solutions use techniques like induction, prime factorization, and modular arithmetic to prove various properties about sums, sequences, and divisibility. 3. One problem proves that the sum of differences between paired integers ends in 9, while another shows any rational number in a prime-defined sequence will eventually reach 0.

Uploaded by

Emerson Soriano
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

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 5
n
all of whose
digits are odd.
2. Determine all nite nonempty sets S of positive integers satisfying
i +j
gcd(i, j)
is an element of S for all i, j in S,
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 a
i
, b
i
(1 i 999)
so that for all i, [a
i
b
i
[ equals 1 or 6. Prove that the sum
[a
1
b
1
[ +[a
2
b
2
[ + +[a
999
b
999
[
ends in the digit 9.
Solution: Let k denote the number of pairs a
i
, b
i
with [a
i
b
i
[ = 6. Then the sum in question
is k 6 + (999 k) 1 = 999 + 5k, which ends in 9 provided k is even. Hence it suces to show that
k is even.
Write k = k
odd
+k
even
, where k
odd
(resp. k
even
) is equal to the number of pairs a
i
, b
i
with a
i
, b
i
both
odd (resp. even). Since there are as many even numbers as odd numbers between 1 and 1998, and
since each pair a
i
, b
i
with [a
i
b
i
[ = 1 contains one number of each type, we must have k
odd
= k
even
.
Hence k = k
odd
+k
even
is even as claimed.
4. For a real number x, let x| 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 p
1
, p
2
, p
3
, . . . be the prime numbers listed in increasing order, and let x
0
be a real number between
0 and 1. For positive integer k, dene
x
k
= 0 if x
k1
= 0,
_
p
k
x
k1
_
if x
k1
,= 0,
where x = x x| denotes the fractional part of x. Find, with proof, all x
0
satisfying 0 < x
0
< 1
for which the sequence x
0
, x
1
, x
2
, . . . eventually becomes 0.
Solution: The sequence eventually becomes 0 if and only if x
0
is a rational number.
First we prove that, for k 1, every rational term x
k
has a rational predecessor x
k1
. Suppose x
k
is
rational. If x
k
= 0 then either x
k1
= 0 or p
k
/x
k1
is a positive integer; either way, x
k1
is rational.
If x
k
is rational and nonzero, then the relation
x
k
=
_
p
k
x
k1
_
=
p
k
x
k1

_
p
k
x
k1
_
2 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA
yields
x
k1
=
p
k
x
k
+
_
p
k
x
k1
_,
which shows that x
k1
is rational. Since every rational term x
k
with k 1 has a rational predecessor,
it follows by induction that, if x
k
is rational for some k, then x
0
is rational. In particular, if the
sequence eventually becomes 0, then x
0
is rational.
To prove the converse, observe that if x
k1
= m/n with 0 < m < n, then x
k
= r/m, where r is
the remainder that results from dividing np
k
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 x
0
.
Note that the above argument applies to any sequence p
k
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 (ab)
2
divides ab for every distinct
a, b S.
Solution: We will prove by induction on n, that we can nd such a set S
n
, all of whose ele-
ments are nonnegative. For n = 2, we may take S
2
= 0, 1.
Now suppose that for some n 2, the desired set S
n
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 S
n
. Dene
S
n+1
= L +a : a S
n
0.
Then S
n+1
consists of n + 1 nonnegative integers, since L > 0. If , S
n+1
and either of is
zero, then ( )
2
divides . If L +a, L +b S
n+1
, with a, b distinct elements of S
n
, 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
x
2
y
2
= z
3
t
3
with the property 0 x, y, z, t 10
6
, and let N be the number of integer solutions of the equation
x
2
y
2
= z
3
t
3
+ 1
that have the same property. Prove that M > N.
Solution: Write down two equations in the form
x
2
+t
3
= y
2
+z
3
and x
2
+t
3
= y
2
+z
3
+ 1
Mathematics Olympiad Coachs Seminar, Zhuhai, China 3
and, for each k = 0, 1, 2, . . . , denote y n
k
the number of integer solutions of the equations u
2
+v
3
= k
with the property 0 u, v 10
6
. Clearly n
k
= 0 for all k greater than = (10
6
)
2
+ (10
6
)
3
. Note
that
M = n
2
0
+n
2
1
+ +n
2

and N = n
0
n
1
+n
1
n
2
+ +n
1
n

. (1)
To prove, for example, the second of these equalities, note that to any integer solution of x
2
+ y
3
=
y
2
+z
3
+ 1 with ) x, y, z, t 10
6
there corresponds a k (1 k ) such that
x
2
+t
3
= 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 n
k
and n
k1
ways, respectively. Hence for each k = 1, 2, . . . , there are n
k1
n
k
solutions
of x
2
+ t
3
= y
2
+ z
3
+ 1 with x
2
+ y
3
= y
2
+ z
3
+ 1 = k, which implies the second equality in (1).
The proof of the rst is essentially the same.
It is not hard to deduce from (1) that M > N. Indeed, a little algebra work shows that
M N =
n
2
0
+ (n
0
n
1
)
2
+ (n
1
n
2
)
2
+ + (n
1
n

)
2
+n
2

2
> 0,
since n
0
= 1 > 0.
9. Let p be a prime number greater than 5. For any integer x, dene
f
p
(x) =
p1

k=1
1
(px +k)
2
.
Prove that for all positive integers x and y, the numerator of f
p
(x) f
p
(y), when written in lowest
terms, is divisible by p
3
.
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 suces to check that f
p
(x) f
p
(x + 1) (mod p
3
), or in other words,
0
p1

i=1
_
1
(xp +i)
2

1
(xp +p +i)
2
_
=
p1

i=1
(xp +i +p)
2
(xp +i)
2
(xp +i)
2
(xp +p +i)
2
=
p1

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

y 2zp
y
3
(mod p
2
). ()
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
p1

i=1
2i +p(2x + 1)
(xp +i)
2
(xp +p +i)
2

p1

i=1
2i +p(2x + 1)
i
6
(i 2xp)[i 2p(x + 1)]
=
p1

i=1
2i +p(2x + 1)
i
6
[i
2
2p(2x + 1)i + 4p
2
x(x + 1)]

p1

i=1
2i +p(2x + 1)
i
5
[i 2p(2x + 1)]
=
p1

i=1
2i
2
+pi(2x + 1) 4pi(2x + 1) 2p
2
(2x + 1)
2
i
5

p1

i=1
2
i
3
+ 3p(2x + 1)
p1

i=1
1
i
4
(mod p
2
).
The rest of our proof is based on the following lemma.
Lemma. If n is an integer not divisible by p 1, then

p1
i=1
i
n
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
p1
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,
p1

i=1
i
n

p1

i=1
(ig)
n
= g
n
p1

i=1
i
n
Because g
n
, 1 (mod p), we must have

p1
i=1
i
n
0 (mod p), as desired.
For p 7, we may apply this with n = 4. Combining this with the previous congruence, we get
p1

i=1
2i +p(2x + 1)
(xp +i)
2
(xp +p +i)
2

p1

i=1
2
i
3
(mod p
2
).
Now note that
p1

i=1
2
i
3

p1

i=1
_
1
i
3
+
1
(p i)
3
_

p1

i=1
p(p
2
3pi + 3i
2
)
i
3
(p i)
3

p1

i=1
3i
2
p
i
3
(p i)
3

p1

i=1

3p
i
4
0 (mod p
2
),
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 innite series:
1
(y +zp)
2
= y
2
(1 +p(z/y))
2
= y
2
(1 2p(z/y) + 3p
2
(z/y)
2
+ ).
This expansion of course does not converge in the real numbers; however, it does converge in a
dierent 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)
1
+
(2)
2
+ +
(n)
n
2n.
11. Let a, b be integers greater than 2. Prove that there exists a positive integer k and a nite sequence
n
1
, n
2
, . . . , n
k
of positive integers such that n
1
= a, n
k
= b, and n
i
n
i+1
is divisible by n
i
+ n
i+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 nite sequence n
1
, n
2
, . . . , n
k
of positive integers such that n
1
= a,
n
k
= b, and n
i
n
i+1
is divisible by n
i
+ n
i+1
for each i (1 i < k). The problem asks to prove that
a b for all a, b > 2.
It is not dicult to check that is an equivalence relation: it is reexive (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 (n
i
+ n
i+1
)|n
i
n
i+1
holds whenever n
i+1
=
n
i
(d 1), where d is any divisor of n
i
greater than 1. Indeed,
n
i
+n
i+1
= n
i
d|n
2
i
|n
2
i
(d 1) = n
i
n
i+1
.
Therefore, if d is any divisor of n, then n n(d 1)
k
for any nonnegative integer k, and n
n(d 1) n(d 1)(d 2) n

d1
i=c
i for any natural number c < d.
Whenever a > b > 2, there exists a natural number such that (b 1)

> a. Let
X =
(b1)

i=b
i.
Then
a a
a1

i=b
i =
a

i=b
i (b 1)

i=b
i (b 1)

i=b
i
(b1)

i=a+1
i = X,
and
b b(b 1)

b(b 1)

(b1)

i=b+1
i = X.
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
satises the conditions of the problem. For any positive integer n 4, n

= (n 1)(n 2) 3,
hence n

2n

by the above argument. It follows that n n 1 for n 4 by n

2n

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 n
i
+n
i+1
|n
i
n
i+1
if and only if
(n
i
+n
i+1
)|[(n
i
+n
i+1
)n
i
n
i
n
i+1
] = n
2
i
.
This means that n
i+1
can be d n
i
where d is any divisor of n
2
i
, as long as that is positive. We
repeatedly use this to obtain the following facts.
Fact 1 By successively taking n
i
= 4a, 4a(a 1), 4a(a + 1), we have
4a 4a
2
4a = 4a(a 1) 8a
2
4a(a 1) = 4a(a + 1) 4(a + 1)
2
4a(a + 1) = 4(a + 1)
for integers a 2.
Fact 2 4 4
2
4 = 12.
Fact 3 2a 2a
2
2a = 2a(a 1) for all a 2.
Fact 4 a a
2
a = a(a 1) for all a 2.
We also note that a(a 1) is even for all integers a.
The rst 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 rst 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 rst 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, dene 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 [ r
p
+ 1, r [ p
q
+ 1.
Solution: Answer: (2, 5, 3) and cyclic permutations.
We check that this is a solution:
2 [ 126 = 5
3
+ 1, 5 [ 10 = 3
2
+ 1, 3 [ 33 = 2
5
+ 1.
Now let p, q, r be three primes satisfying the given divisibility relations. Since q does not divide
q
r
+ 1, p ,= q, and similarly q ,= r, r ,= 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 , 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 lets rst 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 p
q
+ 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 [
q1
2
or p [
q+1
2
; either way, p
q+1
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 [ 2
q
+ 1, so by the lemma, either 2q [ r 1 or r [ 2
2
1. But 2q [ r 1 is impossible as before,
because q divides r
2
+ 1 = (r
2
1) + 2 and q > 2. Hence, we must have r [ 2
2
1. We conclude
that r = 3, and q [ r
2
+ 1 = 10. Because q ,= 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
(5F
2
2k
, 5F
2
2k+2
), (L
2
2k1
, L
2
2k+1
),
where k is a nonnegative integer and F
j
, L
j
are the Fibonacci and Lucas sequences, respec-
tively that is, the sequences dened by F
1
= F
2
= 1, L
1
= 1, L
2
= 3, and the recursive relations
F
j+2
= F
j+1
+ F
j
and L
j+2
= L
j+1
+ L
j
for j 1. Note that we amended the Lucas sequence by
considering L
1
= 1 and L
0
= 2.
Let g = gcd(m, n) and write m = gm
1
and n = gn
1
. Because 9mn is a perfect square, m
1
and n
1
are perfect squares. Let m
1
= x
2
and n
1
= y
2
. The given condition becomes
(gx
2
+gy
2
5)
2
= 9g
2
x
2
y
2
.
Taking the square root on both sides yields
g(x
2
+y
2
) 5 = 3gxy,
or
g(x
2
+y
2
3xy) = 5.
If g(x
2
+y
2
+ 3xy) = 5, then x
2
+y
2
+ 3xy 5, implying that x = y = g = 1 and (m, n) = (1, 1).
Otherwise, g(x
2
+y
2
3xy) = 5 and g = 1 or 5. Fix g equal to one of these values, so that
x
2
3xy +y
2
=
5
g
. (1)
We call an unordered pair (a, b) a g-pair if (x, y) = (a, b) (or equivalently, (x, y) = (b, a)) satises (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 coecient
of x in a monic quadratic function (xr
1
)(xr
2
) equals (r
1
+r
2
), implying that (3b a, b) should
also satisfy (1). Indeed,
b
2
3b(3b a) + (3b a)
2
= a
2
3ab +b
2
=
5
g
.
Also, if b > 2, note that
a
2
3ab +b
2
=
5
g
< b
2
.
It follows that a
2
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 a

= b and b

= 3b a, (b

, 3b

) = (a, b).
Furthermore, if a b, note that a ,= b because otherwise a
2
= g > 0, which is impossible. Thus,
a > b and
a
2
3ab +b
2
=
5
g
> b
2
a
2
,
Mathematics Olympiad Coachs Seminar, Zhuhai, China 9
which implies that a(2a3b) > 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 L
2
= 1, L
3
= 4 = r(1), and that
L
2k+3
= L
2k+2
+L
2k+1
= (L
2k+1
+L
2k
) +L
2k+1
= (L
2k+1
+ (L
2k+1
L
2k1
)) +L
2k+1
= 3L
2k+1
L
2k1
for k 0. For g = 5, the Fibonacci numbers satisfy an analogous recursive relation, and F
2
= 1,
F
4
= 3 = r(5). Therefore, (m, n) = (L
2
2k1
, L
2
2k+1
) and (m, n) = (5F
2
2k
, 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 m
2
+n
2
.
Solution: Half of the answers are
(m

, n

) = (a
1
r
+1
1
+a
2
r
+1
2
, a
1
r

1
+a
2
r

2
) for = 0, 1, 2, . . . ,
and
(m

, n

) = (a
2
r
+1
1
+a
1
r
+1
2
, a
2
r

1
+a
1
r

2
) for = 0, 1, 2, . . . ,
where
r
1
=
5 +

21
2
, r
2
=
5

21
2
;
a
1
=
21

21
42
, a
2
=
21 +

21
42
.
The other half of the solutions are obtained by reversing the above solutions.
Assume that (m, n) satises the conditions of the problem. Then there is a positive integer k such
that
k(mn 1) = m
2
+n
2
. (1)
It is clear that (m, n) ,= (1, 1). Without loss of generality we may assume that m n. Then m 2.
Note that m ,= n: otherwise we would have k(m
2
1) = 2m
2
, but 2 < 2m
2
/(m
2
1) < 3 for m 2.
Hence we may assume that m n + 1. We consider the quadratic equation
x
2
knx +n
2
+k = 0. (2)
Let x
1
and x
2
be the two solutions of (2). Then x
1
x
2
= n
2
+ k and x
1
+ x
2
= kn. By equation (1),
equation (2) has an integer root x
1
= m. Hence equation (2) has another integer root x
2
= knm =
(n
2
+k)/m. Because m, n, k > 0, x
2
> 0. We claim that x
2
< n if n 2. Indeed, nx
2
= n+mkn,
so
(mn 1)(n x
2
) = (mn 1)(m+n) n(m
2
+n
2
)
= mn
2
mn n
3
.
10 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA
Therefore, x
2
< n if and only if m(n
2
1) n
3
n > 0.
If m n + 2, then
m(n
2
1) n
3
n (n + 2)(n
2
1) n
3
n = 2(n
2
n 1) > 0,
implying that x
2
< n.
If n 3 and m = n + 1, then
m(n
2
1) n
3
n = n
2
2n 1 > 0,
implying that x
2
< n.
If n = 2 and m = 3, then k =
13
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 (m

, n

) = (n, kn m),
m > n = m

> n

, also satisfying the conditions of the problem, where


k =
m
2
+n
2
mn 1
=
(m

)
2
+ (n

)
2
m

1
.
We can repeat this process if n

2. Hence to nd all pairs of positive integers (m, n) satisfying the


conditions of the problem, we may start by assuming n = 1. Then
k =
m
2
+ 1
m1
= m+ 1 +
2
m1
,
implying that (m1) 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, 5nm). 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 (x
k+1
, x
k
) or (y
k+1
, y
k
) of the sequences x
k

k=0
and y
k

k=0
, given
by
x
k+2
= 5x
k+1
x
k
and y
k+2
= 5y
k+1
y
k
,
where x
0
= 1, x
1
= 2 and y
0
= 1, y
1
= 3. In either case, because the characteristic polynomial
of the sequence is x
2
5x + 1, with roots r
1
and r
2
, there exist coecients a
1
, a
2
, b
1
, b
2
such that
x
k
= a
1
r
k
1
+a
2
r
k
2
and y
k
= b
1
r
k
1
+b
2
r
k
2
. Solving for a
1
, a
2
and b
1
, b
2
using the initial values x
0
, x
1
and
y
0
, y
1
gives the desired answers.
15. Let A be a nite set of positive integers. Prove that there exists a nite set B of positive integers
such that A B and

xB
x =

xB
x
2
.
Solution: For any nite set S of positive integers, let
D(S) =

xS
x

xS
x
2
.
If D(A) = 0, then we take B = A. If D(A) < 0, then let m = max A. Write A

k
= 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
+m
2
k)
= (m+ 1)
k
k(m+k)
2
D(A

k
) D(A)
Mathematics Olympiad Coachs Seminar, Zhuhai, China 11
and hence D(A

k
) > 0. Thus, it suces to nd a nite set B containing A

such that D(B) = 0,


because then B contains A as well. This reduces the problem to the next and nal case.
Assume that D(A) > 0, and write A
0
= A. Dene A
k+1
= A
k

_

xA
k
x 1
_
recursively for
k = 0, 1, . . . , D(A) 1. If D(A
k
) > 0, we have A
k
,= 1 and hence
max A
k
<

xA
k
x
2
=

xA
k
x D(A
k
) <

xA
k
x.
Therefore,

xA
k
x 1 > max A
k
and A
k+1
has one more element than A
k
. It follows that
D(A
k+1
) =

xA
k+1
x

xA
k+1
x
2
=

xA
k
x(

xA
k
x 1)

xA
k
x
2
(

xA
k
x 1)
2
=

xA
k
x

xA
k
x
2
1 = D(A
k
) 1.
Because D(A
0
) > 0, it follows that D(A
k
) = D(A) k > 0 for k < D(A) and that D(A
D(A)
) = 0.
Taking B = A
D(A)
completes the proof.
16. Let P(x) be a polynomial with integer coecients. The integers a
1
, a
2
, . . . , a
n
have the following
property: for any integer x there exists an 1 i n such that P(x) is divisible by a
i
. Prove that
there is an 1 i
0
n such that a
i
0
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
x
i
such that P(x
i
) is not divisible by a
i
. Hence there is a prime power p
k
i
i
which divides a
i
and does
not divide P(x
i
). Some of powers of p
k
1
i
, p
k
2
2
, . . . , p
k
n
n
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 p
k
1
i
, p
k
2
2
, . . . , p
k
m
m
, m n and p
1
, p
2
, . . . , p
m
are distinct. Note that each a
i
is divisible by
some term of this sequence.
Since p
k
1
i
, p
k
2
2
, . . . , p
k
m
m
are pairwise relative prime, the Chinese remainder theorem yields a solu-
tion of the simultaneous congruences
x x
1
(mod p
k
1
1
), x x
2
(mod p
k
2
1
), . . . , x x
m
(mod p
k
m
m
).
Now since P(x) is an integer polynomial, x x
i
(mod p
k
j
j
) implies that P(x) P(x
i
) (mod p
k
j
j
),
for each i = 1, 2, . . . , m. Then none of the numbers p
k
1
i
, p
k
2
2
, . . . , p
k
m
m
divided P(x). But each a
i
is
divisible by p
k
j
j
for some 1 j m, It follows that no a
i
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 satises the desired property. To accommodate the negative integers as well, we switch to
base 4. That is, we represent every integer in the form

k
i=0
c
i
(4)
i
, with c
i
0, 1, 2, 3 for all
i and c
k
,= 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 c
i
and d
i
be two distinct nite sequences of
elements of 0, 1, 2, 3, and let j be the smallest integer such that c
j
,= d
j
. Then
k

i=0
c
i
(4)
i
,
k

i=0
d
i
(4)
i
(mod 4
j
),
so in particular the two numbers represented by c
i
and d
i
are distinct. On the other hand, to
show that n admits a base 4 representation, nd an integer k such that 1 + 4
2
+ + 4
2k
n and
express n + 4 + + 4
2k1
as

2k
i=0
c
i
4
i
. Now set d
2i
= c
2i
and d
2i1
= 3 c
2i1
, and note that
n =

2k
i=0
d
i
(4)
i
.
Second Solution: For any S Z, let S

= a + 2b[ a, b S. Call a nite set of integers


S = a
1
, a
2
, . . . , a
m
Z good if [S

[ = [S[
2
, i.e., if the values a
i
+ 2a
j
(1 i, j m) are distinct.
We rst prove that given a good set and n Z, we can always nd 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 + 2a
i
, (n 2k) + 2a
i
, a
i
+ 2k, a
i
+ 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 suciently 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 X
0
= 0, we thus obtain a sequence of sets X
1
, X
2
, X
3
, . . . such that for
each positive integer j, X
j
is a good superset of X
j1
and X

j
contains the jth term of the sequence
1, 1, 2, 2, 3, 3, . . . . It follows that
X =

_
j=0
X
j
has the desired property.
18. Suppose the sequence of nonnegative integers a
1
, a
2
, . . . , a
1997
satises
a
i
+a
j
a
i+j
a
i
+a
j
+ 1
for all i, j 1 with i +j 1997. Show that there exists a real number x such that a
n
= nx| for all
1 n 1997.
Solution: Any x that lies in all of the half-open intervals
I
n
=
_
a
n
n
,
a
n
+ 1
n
_
, n = 1, 2, . . . , 1997
will have the desired property. Let
L = max
1n1997
a
n
n
=
a
p
p
and U = min
1n1997
a
n
+ 1
n
=
a
q
+ 1
q
.
Mathematics Olympiad Coachs Seminar, Zhuhai, China 13
We shall prove that
a
n
n
<
a
m
+ 1
m
,
or, equivalently,
ma
n
< n(a
m
+ 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)a
n
< n(a
mn
+ 1), and adding n(a
mn
+ a
n
) na
m
yields (). If m < n, then the induction hypothesis yields ma
nm
< (n m)(a
m
+ 1), and adding
ma
n
m(a
m
+a
nm
+ 1) gives ().
19. Let p be a prime number, and let m and n be integers greater than 1. Suppose that m
p(n1)
1 is
divisible by n. Show that m
n1
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 q
0
be a prime for which this quantity is minimized. Let k be the exponent of p
in the prime factorization of q
0
1; then n 1 (mod p
k
) and q
0
, 1 (mod p
k+1
). In particular,
the greatest common divisor of p(n 1) and q
0
1 is divisible by p
k
but not by p
k+1
, and so also
divides n 1. Therefore, there exist integers r and s so that rp(n 1) + s(q
0
1) = n 1; since
m
p(n1)
m
q
0
1
1 (mod q
0
), we deduce m
n1
1 (mod q
0
). We conclude that m
n1
1 and n
have the common factor q
0
.
Note: This problem generalizes a problem from MOP 1997: show that 2
n1
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 < 2
n
, there is a sequence of at most rn moves transforming (a, b, c) into
(a

, b

, c

) with a

= 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
2
m1
b < 2
m
. Since 1 b c/2 < 2
n1
, we have 1 m n1. Dene a sequence x
0
= a, x
1
= b,
and x
k
= x
k1
+x
k2
for k 2.
Lemma Every integer y b can be expressed in the form
+x
i
i
+ +x
i

where 0 < b and i


1
< i
2
< < i

and x
i

y < x
i

+1
.
Proof: Since x
i
are increasing, there is a unique i 1 for which x
i
y < x
i+1
. We use strong
induction on i. If y x
i
< b, we let = y x
i
and we are done. Otherwise x
1
= b y x
i
<
14 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA
x
i+1
x
i
= x
i1
so there is a unique j 1 such that x
i
y x
i
< x
j+1
, and j < i, so we nish by
applying the inductive hypothesis to y x
i
.
Write c = + x
i
1
+ + x
i

, where 0 < b and 0 < i


1
< < i

. Since x
k+2
= x
k+1
+ x
k
=
2x
k
+x
k1
2x
k
for k 1, we have
x
2n2m+3
2
nm+1
x
1
2
nm+1
2
m1
= 2
n
> c,
so i
1
< i
2
< < i

< 2n 2m+ 3.
Using 2n 2m + 1 addition moves we can change (a, b, c) = (x
0
, x
1
, c) into (x
2
, x
1
, c), then into
(x
2
, x
3
, c), and so on, until we reach (x
2n2m+2
, x
2n2m+1
, c). If instead intersperse at most 2n2m+2
moves between these to subtract from c the x
i
j
in the representation of c as they produced in the
rst two coordinates, we will eventually reduce c to . Now we can perform 2n2m+1 substraction
moves to change (x
2n2m+2
, x
2n2m+1
back to (x
2n2m
, x
2n2m+1
), and so on, undoing the previous
operations on the rst 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, < 2
m
, 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 (6n6m+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 x
2
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 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 c
2
x and x d
2
x. Hence, it is stable under x c
2
(d
2
x) = x +(c
2
d
2
).
Similarly, S is stable under x x + (d
2
c
2
). Hence, S is stable under x x + n and x x n,
whenever n is an integer linear combination of nitely many numbers in T = c
2
d
2
[ c, d S .
By condition (a), S ,= and hence T ,= as well. For the sake of contradiction, assume that some
p divides every element in T. Then c
2
d
2
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, c
2
c S, by condition (b), so
c
2
c c (mod p) or c
2
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, , 0 (mod p).
Similarly, by condition (a), gcd(a2, b 2) = 1, so p cannot divide both a2 and b 2. Thus, there
is an element of S, call it , such that , 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 ,= 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 nite. By construction, m = gcd y [ y A = 1, and m can be written as
an integer linear combination of nitely many elements in A and hence in T. Therefore, S is stable
under x x + 1 and x x 1. Because S is nonempty, it follows that S is the set of all integers.
Second Solution: Dene T, a, and b as in the rst 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), a
2
a, b
2
b S. Therefore, p divides a
2
b
2
, x
1
= (a
2
a)
2
a
2
, and
x
2
= (b
2
b)
2
b
2
. Because gcd(a, b) = 1, both gcd(a
2
b
2
, a
3
) and gcd(a
2
b
2
, b
3
) equal 1, so p does
not divide a
3
or b
3
. But p does divide x
1
= a
3
(a 2) and x
2
= b
3
(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 , B.
First Solution: (By Reid Barton) For a positive integer n, let Z
n
denote the set of residues
modulo n. Let (n) be the Euler function which is dened to be the number of integers between
1 and n relatively prime to n. Call a set A of residues modolo 3
n
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 3
n
1 sum-free sets of 3
n1
residues modulo 3
n
such that
every nonzero residue modulo 3
n
appears in exactly 3
n1
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 3
n
1 sum-free subsets A
1
,
A
2
, . . . , A
3
n
1
of Z
3
n such that every element of Z
3
n belongs to exactly 3
n1
of the A
i
. Construct
sets B
1
, B
2
, . . . , B
3
n
1
by
B
i
= x Z
3
n+1|x m

(mod 3)
n
, m

A
i
.
Then each B
i
contains 3[A
i
[ = 3
n
residues, and the B
i
are sum-free, because if a, b B
i
, (a+b) mod 3
n
is not in A
i
so a +b is not in B
i
. Moreover, each element x of Z
3
n+1 which is not 0 modulo 3
n
(i.e.,
all elements except 0, 3
n
, 2 3
n
) is in exactly 3
n1
of the B
i
, namely those corresponding to the A
i
containing x mod 3
n
.
Now dene sets
C = 3
n
, 3
n
+ 1, . . . , 2 3
n
1
and
U = x Z
3
n+1| gcd(x, 3) = 1 .
Then C Z
3
n+1, [C[ = 3
n
. Note that C is sum-free, because if a, b C with 3
n
a, b < 2 3
n
then
2 3
n
a +b < 4 3
n
so a +b is not congruent modulo 3
n+1
to an element of C. For each y U, let
C
y
= yC = yx|x C . Then C
y
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
C
y
with ya+yb C
y
, then a and b would be elements of C summing to an element of C. Also, every
C
y
contains [C[ = 3
n
residues because multiplication by y is invertible. Since [U[ = (3
n+1
) = 23
n
,
there are 2 3
n
of sets C
y
s.
Consider the sets
B
1
, B
2
, . . . , B
3
n
1
, C
1
, C
2
, C
4
, C
5
, C
7
, . . . , C
3
n+1
2
, C
3
n+1
1
.
There are 3
n
1 + 2 3
n
= 3
n+1
1 of these sets, so it suces to check that every nonzero residue
modulo 3
n+1
appears in exactly 3
n
of them. Let m be a nonzero residue modulo 3
n+1
, and write
m = 3
k
s, 0 k n, gcd(s, 3) = 1. We consider two cases.
(i) k < n. Then m is a nonzero residue modulo 3
n
, so m is contained in exactly 3
n1
of the
sets B
i
, namely those which correspond to A
i
with m

A
i
(where m m

(mod 3)
n
). The
number of sets C
i
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 ,= 0, as z ranges over Z
3
n+1, one third of the
residues zm are in C; likewise, since 3m ,= 0, one third of the residues 3zm are in C. Since
U = Z
3
n+1 3Z
3
n+1, zm C for one third of the values z U. So m is in one third of the sets
C
y
, giving
1
3
[U[ = 2 3
n1
more sets containing m. The total number of sets containing m is
then 3
n1
+ 2 3
n1
= 3
n
.
(ii) k = n. Then m = 3
n
or 2 3
n
(s = 1 or 2 respectively). Then m mod 3
n
= 0, so m does not
appear in any of the sets A
i
. However, m appears in every set C
y
with y s (mod 3), so m
appears in 3
n
of the C
y
. Thus the total number of sets containing m is again 3
n
.
Thus the sets B
i
, C
y
have the desired properties and the Lemma holds by induction.
Now let 3
n
be a power of 3 larger than the sum of any two elements of A. By the Lemma, there
exist 3
n
1 sets S
1
, . . . , S
3
n
1
of 3
n1
residues modulo 3
n
such that every nonzero residue modulo
3
n
appears in exactly 3
n1
of the S
i
. Let n
i
be the number of elements of A contained in S
i
. Since
every element of A appears 3
n1
times,
3
n
1

i=1
n
i
= 3
n1
[A[
so some n
i
is at least
3
n1
[A[
3
n
1
>
1
3
[A[ =
2001
3
= 667.
Let B be the set of elements of A contained in S
i
. Then [B[ 668, and if u, v B, then u +v / B,
because S
i
is sum-free. Thus the set B has the desired properties.
Second Solution: Let the elements of A be a
1
, . . . , a
2001
. Let p be a prime number such that
p 2 (mod 3) and p is larger than all the a
i
. Such a prime p exists by Dirichlets 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 nitely 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 innitely many odd primes that are congruent to 2 modulo 3. Specically,
one such prime is larger than all a
i
.
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 ka
i
is mediocre. Thus, there are
2001(p + 1)
3
= 667(p + 1)
pairs of (k, i) such that ka
i
is mediocre. By the Pigeonhole Principle, there exists some k for
which the set
B = a
i
[ ka
i
is mediocre
has at least 668 elements.
We now claim that this B satises the desired properties. It suces 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
satises the desired properties.
23. For a given prime p, nd 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 dierent 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 A
1
. Denote by x
i
the number of edges with endpoint A
1
colored in the
color i. Then, of course,
x
1
+x
2
+ +x
p+1
= n 1. (1)
Invoking the Pigeonhole principle, we are going to show that
x
i
p 1 for each i = 1, 2, . . . p + 1. (2)
Assume (2) is not true. Without loss of generality, let the edges A
1
A
2
, A
1
A
3
, . . . A
1
A
p+1
be of the
i
th
color. Then, according (b), each of he edges A
k
A

, 2 k < p + 1, is of the i
th
color as well.
Take any vertex B of the graph. At least one of the p + 1 edges BA
1
, BA
2
, . . . , BA
p+1
is of the i
th
color: otherwise, one of the other p colors would double up, making two edges BA
k
and BA

both
the same color m ,= i. But then (b) imply that A
k
A

is of the m
th
color, a contradiction.
Thus the edge BA
j
is of the i
th
color for some j = 1, 2, . . . , p + 1. Then since BA
j
and A
j
A
k
are of
color i, it follows that BA
k
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 i
th
color, and this contradicts (a).
Thus we proved (2) which, combined with (1), gives
n 1 = x
1
+x
2
+ +x
p+1
(p + 1)(p 1) = p
2
1.
This means n p
2
. 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 p
2
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 p1. Let A
1
= (a
1
, b
1
) and A
2
= (a
2
, b
2
) be vertices of G. if b
1
,= b
2
, then gcd(b
1
b
2
, p) = 1
as p is a prime. Then the congruence
(b
1
b
2
)x = a
1
a
2
(mod p)
has a unique solution x = i in the set 0, 1, 2, . . . , p 1. In this case, color edges A
1
A
2
with color
i + 1. If b
1
= b
2
, 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 p
2
.
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 x| 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
[(r + 1)x] [rx] =
_
[x] [rx] < p [x]
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 < p1, (r, 1) is positive, so exactly one of (r, b), (r, c), (r, d) is also positive.
Lemma If r
1
, r
2
, x 1, . . . , p 1 have the property that (r
1
, x) and (r
2
, x) are negative but (r, x)
is positive for all r
1
< r < r
2
, then
r
2
r
1
=
_
p
x
_
or r
2
r
1
=
_
p
x
_
+ 1.
Proof: Note that (r

, x) is negative if and only if r

x +1, r

x +2, . . . , (r

+1)x contains a multiple


of p. In particular, exactly one multiple of p lies in r
1
x, r
1
x + 1, . . . , r
2
x. Because [r
1
x] and [r
2
x]
are distinct elements of p [x], . . . , p 1, we have
p x + 1 < r
2
x r
1
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 dierence between 7 and 3 here is
p
x
| +1. The next r such that (r, x) is negative is r = 10; 10 7 =
p
x
|.)
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 <
p
2
and c, d >
p
2
. Put s
1
=
p
b
|, so that s
1
is the smallest positive integer such
that (s
1
, b) is negative. Then exactly one of (s
1
, c) and (s
1
, d) is positive, say the former. Because s
1
is also the smallest positive integer such that (s
1
, c) is positive, or equivalently such that (s
1
, p c)
is negative, we have s
1
=
p
pc
|. The lemma states that consecutive values of r for which (r, b) is
negative dier by either s
1
or s
1
+ 1. It also states (when applied with x = p c) that consecutive
values of r for which (r, c) is positive dier by either s
1
or s
1
+ 1. From these observations we will
show that (r, d) is always negative.
r 1 s
1
s
1
+ 1 s

+ 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 > s
1
such that (s, d)
is positive; then (s, b) and (s, c) are both negative. If s

is the last integer before s such that (s

, b) is
negative (possibly equal to s
1
), then (s

, d) is negative as well (by the minimal denition of s). Also,


s s

= s
1
or s s

= s
1
+ 1.
Likewise, if t were the next integer after s

such that (t, c) were positive, then


t s

= s
1
or t s

= s
1
+ 1.
From these we deduce that [t s[ 1. However, we cant have t ,= s because then both (s, b) and
(t, b) would be negative and any two values of r for which (r, b) is negative dier by at least
s
1
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 cant have [t s[ 1,
contradicting our ndings and thus proving that (r, d) is indeed always negative.
Now if d ,= 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 x| denote the smallest integer greater than or equal to x, let x| denote the
greatest integer less than or equal to x, and let x denote the fractional part of x, which is given
by x x|. Let p be a prime number. For integers r, s such that rs(r
2
s
2
) 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
3
_
f(r, s)
_
2(p 1)
3
_
.
20 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA
Solution: We assume that p is suciently 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) = p1f(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) = 2(p 1)/3|. So we may assume s 4.
Let g
1
(s) be the number of a 1, . . . , (p 1)/2 such that as/p < 1/2; and let g
2
(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 g
1
(s) = g
2
(s) = f(s)/2. We consider two cases.
(a) s [4, p/4]. Note that

f(s)
p 1
2

g
1
(s)
_
p 1
2
g
1
(s)
_


s
2
+
p
2s
.
To see this, divide s, 2s, . . . , (p1)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 t 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

2 +
p
8
and the right side is less than (p 1)/6 for p suciently 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
(p 1)/3| f(s) 2(p 1)/3|; 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) = 2g
2
(s), g
2
(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)
. .
k+1 groups
.
From the earlier observation, each group can provide at most two as 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 a
1
, a
2
, a
3
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 ra
1
, ra
2
, ra
3
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 oers $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 T be the projective plane of order p (which this solution refers to as the projective plane, for
short), dened as follows. Let / be the ordered triples (a, b, c) of integers modulo p, and dene the
equivalence relation by (a, b, c) (d, e, f) if and only if (a, b, c) = (d, e, f) for some . Then
let T = (/(0, 0, 0)) /. We let [a, b, c] T denote the equivalence class containing (a, b, c), and
we call it a point of T. Because /(0, 0, 0) contains p
3
1 elements, and each equivalence class
under contains p 1 elements, we nd that [T[ = (p
3
1)/(p 1) = p
2
+p + 1.
Given q T, 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-dened regardless of how we write q = [, , ], and that (x, y, z) satises 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 T is in one-to-one correspondence with T

, 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.)
Dene : T T by ([a, b, c]) = [b, c, a]. Given a point q T, we say we rotate it to obtain q

if
q

= (q). Similarly, given a subset T T, we say we rotate it to obtain T

if T

= (T).
Given a point q ,= [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 p
2
+ p points in T [1, 1, 1], it follows
that there are p(p + 1)/3 distinct triplets. Let o be the set of these triplets.
Given a line = [[, , ]] ,= [[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 ,= [1, 1, 1] on [[, , ]],
[[, , ]], and [[, , ]] can be partitioned into triplets. More specically, we will show below that
(ii) there are exactly 3p such points q ,= [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
,

1
,= [[1, 1, 1]], and suppose that [T

1
T

1
[ > 3. We claim that
1
and

1
are
rotations of each other. Suppose otherwise for sake of contradiction. Let
2
,
3
be the rotations of
1
,
and let

2
,

3
be the rotations of

1
. We are given that T

1
and T

1
share more than three triplets;
22 Zuming Feng ([email protected]), Phillips Exeter Academy, Exeter 03833, USA
that is,
1

2

3
intersects

3
in more than 9 points. Because
1
and

1
are not rotations
of each other, each
i
is distinct from all the

j
. Hence,
i

j
contains exactly one point for each i
and j. It follows that
1

3
and

3
consists of at most 3 3 = 9 points, a contradiction.
Hence, our assumption as wrong, and [T

1
T

1
[ > 3 only if
1
and

1
are rotations of each other.
Just as there are p(p +1) points in T [1, 1, 1], there are p(p +1) lines in T

[[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 o of p(p+1)/3 elements (namely, the triplets of T), along with p(p+1)/3
subsets of o (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 ,= [1, 1, 1], then the triplet q, (q),
2
(q) contains
three distinct points, and (ii) if
1
= [[, , ]] ,= [[1, 1, 1]], then there are 3p points q ,= [1, 1, 1] on
[[, , ]] [[, , ]] [[, , ]].
To prove (i), we rst show that x
3
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 x
3
1 (mod p), and by Fermats Little Theorem
we also have x
p1
1 (mod p). Hence,
x = x
3r+(p1)s
=
_
x
3
_
r
_
x
p1
_
s
1
r
1
s
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
p1
)
n
1 (mod p).)
Now, if q = [a, b, c] ,= [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
= [[, , ]] ,= [[1, 1, 1]],
2
= [[, , ]], and
3
= [[, , ]]. Because
[[, , ]] ,= [[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 nd 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 q
0
=
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 (q
0
) =
2

3
and
2
(q
0
) =
3

1
; because q
0
,= [1, 1, 1], the three intersection points
q
0
, (q
0
),
2
(q
0
) 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 q
0
, (q
0
),
2
(q
0
) 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