Sei sulla pagina 1di 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 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 (zfeng@exeter.edu), 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 (zfeng@exeter.edu), 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 (zfeng@exeter.edu), 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 (zfeng@exeter.edu), 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 (zfeng@exeter.edu), 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 (zfeng@exeter.edu), 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 (zfeng@exeter.edu), 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 (zfeng@exeter.edu), 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 (zfeng@exeter.edu), 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 (zfeng@exeter.edu), 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 (zfeng@exeter.edu), 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.

Potrebbero piacerti anche