Olym Math
Olym Math
Olym Math
OLYMPIAD
PROBLEM SOLVING
Julian Arif
0856 94218828
1 Invariants
An invariant is some aspect of a problemtypically a numerical quantitythat
does not change, even if many other properties do change. You can use often
use invariants to simplify difcult problems. Some examples of invariants are
parity, divisibility, and symmetry.
Example 1.1 Two diametrically opposite corners of a chess board are deleted. Is
it possible to tile the remaining 62 squares with 31 dominos?
Solution: No. Each domino covers one red square and one black square. But
diametrically opposite corners are of the same color, so such a tiling is
impossible.
Example 1.2 The numbers 1, 2, . . . , 10 are written in a row. Show that no
matter what choice of sign is put in between them, the sum will never be 0.
Solution: The sum 1 + 2 + + 10 = 55, an odd integer. Since parity is not
aected by the choice of sign, for any choice of sign 1 2 10 will never
be even, so in particular it will never be 0.
Example 1.3 All the dominos in a set are laid out in a chain according to the
rules of the game. If one end of the chain is a 6, what is at the other end?
Solution: At the other end there must also be a 6. Each number of spots must
occur in a pair, so that we may put them end to end. Since there are eight 6s,
this last 6 pairs of with the one at the beginning of the chain.
Example 1.4 Let a1, a2, . . . , an represent an arbitrary arrangement of the
numbers 1, 2, 3, . . . , n. Prove that, if n is odd, then the product
(a1 1)(a2 2)(a3 3) (an n)
is even.
Solution: Consider the sum of the terms:
(a1 1) + (a2 2) + (an n) = (a1 + a2 + an) (1 + 2 + + n)
= (1 + 2 + + n) (1 + 2 + + n)
= 0.
Thus, the sum of the terms is zero no matter what the arrangement. A sum of an
odd number of integers which equals zero (an even number) must contain one
even number, and any product that contains one even number is even.
Example 1.5 (Gaussian Pairing) Find the sum of the first 100 positive integers.
Solution:
S = 1 + 2 + 3 + + 98 + 99 + 100
S = 100 + 99 + 98 + + 3 + 2 + 1 2S = 100 101
Thus, S = 50 101 = 5050.
Example 1.6 Let d(n) denote the number of divisors of a positive integer n. Show
that d(n) is odd if and only if n is a perfect square.
Solution: The symmetry here is that we can always pair a divisor d of n with n/d.
For example, if n = 28, it is natural to pair the divisor 2 with the divisor 14. Thus,
as
we go through the list of divisors of n, each divisor will have a unique partner,
unless
Example 1.8 At first, a room is empty.
1999 Each minute, either one person enters
1000 or
two people leave. After exactly 3
minutes, could the room contain 3
+2
people?
Solution: If there are n people in the room, after one minute, there will be either
n + 1 or n 2 people. The dierence between these two possible outcomes is 3.
After two minutes, there will be either n 1, n + 2, or n 4 people. These
possible values dier from one another by multiples of 3. Continuing for longer
times, we see that at any fixed time t, the possible values for the population of
1999
the room dier from one another by multiples of 3. After 3
minutes, one
1999
possible population is 3
(this population occurs if one person entered each
minute). This is a multiple of 3, so all the possible populations of the room at this
1000
time must also be a multiple of 3. Thus, 3
+ 2 is not a possible population
1999
after 3
minutes.
Example 1.9 A rectangle is tiled with smaller rectangles, each of which has at
least one side of integral length. Prove that the tiled rectangle must also have at
least one side of integral length.
Solution: Note: there are at least fourteen di erent solutions of this problem,
several of which use invariants in dierent ways. See Stan Wagon, Fourteen
proofs of a result about tiling a rectangle, American Mathematical Monthly,
94:601617, 1987 for an account of these solutions.
For ease of discussion and notation, lets call the property of having at least one
integral side good. We must show that the large rectangle is good. Start by
orienting the large rectangle so that the lower-left corner is a lattice point. A
lattice point (m, n) on the plane is one having integer coordinates. Next, we
make the following key observation: If the rectangle werent good, then it would
have only one
lattice point corner. But if the rectangle is good, then it will have either two lattice
point corners (if one dimension is an integer), or four lattice point corners (if both
length and width are integers).
Thus, the rectangle is good if and only if the number of corner lattice points is
even. Well count lattice point corners, and try to show that the number of lattice
point corners of the big rectangle must be even.
Consider the corners of a small rectangle. It may have zero lattice point corners,
or two lattice point corners, or four lattice point corners, but it can not have just
one
or three, because each small rectangle is good (i.e. has at least one integerlength side). Thus, if we count the number of corner lattice points on each small
rectangle and add them up, the sum, which we call S, must be even.
Note, however, that we have overcounted some of the lattice pointsin
particular, we have overcounted any lattice points that occur as the corner of
more than one rectangle. We make the following observations:
We will only count a corner lattice point once, twice, or four timesnever
three times.
The only corner lattice points that are counted exactly once are the corners
of the large rectangle.
Let a denote the number of corner lattice points that we count exactly once (i.e.
the corner lattice points of the large rectangle), let b denote the number of
corner lattice points that we count exactly twice, and let c denote the number of
corner lattice points that we count exactly four times. Then we have:
S = a + 2b + 4c,
so
a = S 2b 4c.
Since S, 2b, and 4c are all even, a is even as well. Thus, the large rectangle has
an even number of corner lattice points, so it must have two or four corner lattice
points. Thus, the large rectangle has at least one side of integral length.
2 Arithmetic Ratios
Example 2.1 (2000 AMC 10 #8) At Olympic High School, 2/5 of the freshmen
and 4/5 of the sophomores took the AMC 10. The number of freshmen and
sophomore contestants was the same. Which of the following must be true?
(A) There are five times as many sophomores as freshmen.
(B) There are twice as many sophomores as freshmen.
(C) There are as many sophomores as freshmen.
(D) There are twice as many freshmen as sophomores.
(E) There are five times as many freshmen as sophomores.
Solution: Lets arbitrarily assume that there are 100 freshmen in the school.
Then 40 freshmen and 40 sophomores took the exam. Thus, there are 50
sophomores in the school, so the answer is (D). Note: it was convenient to
assign a specific value for the number of freshmen, but it is not necessary. We
could let F denote the number of freshmen and conclude, using the same
technique as above, that there are F/2 sophomores. We chose to use 100 for
the number of freshmen because it simplifies the situation.
Example 2.2 (2004 AMC 10A #17 and 2004 AMC 12A #15) Brenda and Sally run
in opposite directions on a circular track, starting at diametrically opposite points.
Each girl runs at a constant speed. They first meet after Brenda has run 100
meters. They next meet after Sally has run 150 meters past their first meeting
point. What is the length of the track in meters?
(A) 250
(B) 300
(C) 350
(D) 400
distance
time
T2 be the time after they first meet until they meet again.
(E) 500
Solution. They start at opposite sides of the track and run in opposite directions,
so they first meet when their combined distance run is L/2. We are told that
Brenda has run 100 meters during this time T1, so
100 = T1 RB .
When they meet again they have together run the full length, L, of the track since
their first meeting. Since their speeds are constant and they ran together L/2 in time
T1, we have T2 = 2T1. Sally has run 150 meters during the time T2, so
(A) Andy
(B) Beth
(C) Carlos
Solution. This is also a rate problem, so we begin with some notation. Let
Ta =
1 Aa
3 Rc
Tb =
1 Aa
4 Rc
Tc =
1 Aa
3 Rc
Example 2.5 (1983 AHSME #7) Alice sells an item at $10 less than the list price
and receives 10% of her selling price as her commission. Bob sells the same
item at $20 less than the list price and receives 20% of his selling price as his
commission. If they both get the same commission, then the list price is
(A) $20
(B) $30
(C) $50
(D) $70
(E) $100
Solution. Let p denote the list price of the item (in dollars). Alices commission is
0.10 (p 10),
and Bobs commission is
0.20 (p 20).
Thus,
0.10 (p 10) = 0.20 (p 20),
so
p = 30.
3 Algebraic Manipulation
3
for x and y, and then substitute the resulting values into the expression x +y . This
technique would certainly work, but would be time-consuming, messy, and probably
error-prone. Instead, well use algebra to construct a more elegant solution. Since
3
3
2
2
our goal is to find x + y , well start by trying to find x + y . We have:
=
=
=
=
(x + y)
2
2
x + 2xy + y
2
2
x +y +23
2
2
x + y + 6.
(x + y)(x + y )
3
3
2
2
3
x + y + x y + xy + y
3
3
x + y + xy(x + y)
3
3
x + y + 3 3.
x + y = 3 3 3 3 = 0.
Useful Lemmas
2
2
2
(x + y) = x + 2xy + y
2
(x y) = x 2xy + y
(x + y) = x + 3x y + 3xy + y = x + y + 3xy(x + y)
(x y) = x 3x y + 3xy y = x y 3xy(x y)
x y = (x + y)(x y)
x y = (x y)(x
integers n
x + y = (x + y)(x
x y + x y xy
+ y ) for all positive
odd integers n (the terms of the second factor alternate in sign)
(x y) + 4xy = (x + y)
n1
n1
+x
n2
n3 2
n2
n2
n3 2
n2
y+x
y + + xy
+y
n1
n1
(x28x+15)/(x2)
= 1.
Solution: If
b
a = 1,
0
We discard x = 3 since this would give 0 . Thus, the only solutions are x = 4 and
x = 5.
Example 3.4 Solve 9 + x
= 10x .
10x
+ 9 = (x
+ 9 = 0.
Observe that
4
x
Thus the solutions are
10x
9)(x
1
x = 3 , 1.
1).
Set y = x x. Then:
(y 20)(y 42) =
2
y 62y + 336 =
504
(y 6)(y 56) = 0.
x x=6
and
x x = 56.
x = 2, 4, 7, 8.
4
= 0
= 0
2
12(x + x ) 56(x + x ) + 89 = 0.
u 2 = x + 1/x ,
Using this, we obtain
2
12(u 2) 56u + 89 = 0,
x+ 1 = 5
2
x
x + 1 = 13 .
x
6
Finally, solving both equations above, we conclude that
x = 1/2, 2, 2/3, 3/2.
= 4,
= 5,
= 0,
v+x+y
= 8.
= 3,
= 3,
= 3,
= 3.
Thus
x = 2, y = 3, u = 5, v = 7.
Example 3.14 Solve the system
(x + y)(x + z) = 30,
(y + z)(y + x) = 15,
(z + x)(z + y) = 18.
Solution: Set u = y + z, v = z + x, w = x + y. Then the system becomes
vw = 30
wu = 15 uv
= 18.
Multiplying these equations we obtain
2 2 2
u v w = 8100,
which we solve to obtain uvw = 90. Next, we solve for u, v, and w to obtain u =
3, v = 6, w = 5, or u = 3, v = 6, w = 5. Then we have:
y+z
z+x
= 3
= 6
x+y
= 5.
4 Polynomials
Theorem 4.1 The Division Algorithm for polynomials. If the polynomial p(x) is
divided by d(x) then there exist polynomials q(x), r(x) such that
p(x) = d(x)q(x) + r(x)
and 0 degree(r(x)) < degree(d(x)).
We can find the quotient q(x) and the remainder r(x) by performing ordinary long
5
4
2
division with polynomials. For example, if x + x + 1 is divided by x + 1 we obtain
5
x + x + 1 = (x + x x 1)(x + 1) + x + 2,
3
1997
is divided
1997
. The remainder
divided by x + x 2.
Solution: There exist polynomials q 1(x) and q2(x) such that p(x) = q1(x)(x 1) 2
and p(x) = q2(x)(x + 2) 4. Thus
p(1) = 2 and p(2) = 4.
Since
2
x + x 2 = (x 1)(x + 2)
2
p(x) = q(x)(x + x 1) + ax + b.
Thus, we have
2 = p(1) = a + b
and
4 = p(2) = 2a + b.
We solve this system to obtain a = 2/3 and b = 8/3. The desired remainder is thus
r(x) = 3x 3.
4
f(x ) = x
20
+x
15
+x
10
+ x + 1 = (x
20
1) + (x
15
1) + (x
10
1) + (x 1) + 5.
5
so
c = 1/6.
Finally,
p(6) = g(6) + 6 =
(6 1)(6 2)(6 3)
+6=
16. 6
Theorem 4.4 The Rational Roots (Zeros) Test: Suppose that a 0, a1, . . . , an are
integers with an 6= 0. If p/q is a rational root (zero) of
n
n1
+ + a1x + a0,
x + a1x + a0 = (x r)(x s)
2
= x (r + s)x + rs.
Equating terms, we obtain
a1 = (r + s) and a0 = rs.
Thus, we conclude the following:
Cubic Polynomials. Suppose that the zeros of the cubic polynomial x + a2x +
a1x + a0 are q, r, s. Then we can factor the cubic polynomial as
3
n1
x + an1x
n2
+ an2x
+ + a1x + a0 = 0.
Then, for k = 1, 2, . . . n,
ak = (1)
nk
Example 4.5 (1983 AIME) What is the product of the real roots of the equation
x 2 + 18x + 30 = 2 x 2 + 18x + 45?
Solution: The only obstacle to an immediate solution of this problem is the
presence of the square root. Thus, a natural technique is to substitute
y = x2 + 18x + 45.
Note that if x is real, then y must be non-negative (i.e. y 0). Then the equation
becomes:
2
y 15
= 2y
(y 5)(y + 3)
= 0.
x + 18x + 20 = 0.
The product of the roots of this quadratic polynomial is 20.
Example 4.6 (1984 USAMO) The product of two of the four zeros of the quartic
equation
4
3
2
x 18x + kx + 200x 1984 = 0
is 32. Find k.
200
1994.
Without loss of generality, let ab = 32. Substituting this into abcd = 1984, we
obtain cd = 62. Then the equations become:
a+b+c+d
30 + ac + ad + bc + bd
= 18
= k
= 200
Recall that we need to compute k, not the values a, b, c, d. Note that if we could
compute ac + ad + bc + bd, then we could compute k. We see that ac + ad + bc
+ bd factors as
ac + ad + bc + bd = a(c + d) + b(c + d) = (a + b)(c + d).
Further,
32c 32d + 62a + 62b = 32(c + d) + 62(a + b).
Next, let u = a + b and v = c + d. Then we have:
u + v = 18 62u
32v = 200.
Solving, we obtain u = 4 and v = 18, so
k = 30 + 4 14 = 86.
Definition 5.1 A binary operation on a set of numbers is a way to take two of the
numbers and produce a third.
Often, a binary operation in a mathematics competition problem will be
expressed using some unusual symbol, such as or . The result of the
operation after it is applied to the numbers a and b would typically be written as
(a, b) or ab, or (a, b) or ab.
Definition 5.2 A function f is a means of associating each element of one set,
called the domain of f, with exactly one element of a second set, called the
range of f.
Definition 5.3 The floor function f(x) = bxc is defined to be the greatest integer
less than or equal to x.
For example, b3.7c = 3, b2c = 2, b2.4c = 3.
Definition 5.4 The ceiling function f(x) = dxe is defined to be the smallest integer
greater than or equal to x.
For example, d3.1e = 4, d1.2e = 1.
Example 5.1 (1993 AHSME #4) Define the operation by
xy = 4x 3y + xy
for all real numbers x and y. For how many real numbers y does 12 = 3y?
(A) 0 (B) 1 (C) 3 (D) 4 (E) more than 4
Solution:
12 = 3y
= 433y+3y
= 12.
Thus, the equation is true for any real number y.
Example 5.2 (1996 AHSME #14) The function E(n) is defined for each positive
integer n to be the sum of the even digits of n. For example, E(5681) = 6 + 8 =
14. What is the value of
(B) 300
(C) 400
(D) 900
(E) 2250
Solution: Rater than determine the values of E(n) individually, observe that the
numbers
00, 01, 02, . . . , 99
contain an equal number of each of the digits 0, 1, . . . , 9. There are a total of
2100 = 200 of these digits, so there are 200/10 = 20 of each digit. Thus,
E(0) + E(1) + E(2) + + E(99) = 20(0 + 2 + 4 + 6 + 8) = 400.
Since E(0) = 0 and E(100) = 0, the required sum is also 400.
9 10 5 .
Definition 6.1 A palindromic integer or palindrome is a positive integer whose
dec-imal expansion is symmetric and that is not divisible by 10. In other words,
one reads the same integer backwards or forwards.
Note: A palindrome in common parlance, is a word or phrase that reads the same
backwards to forwards. The Philadelphia street name Camac is a palindrome. So
are the phrases (if we ignore punctuation) (a) A man, a plan, a canal, Panama!
(b) Sit on a potato pan!, Otis. (c) Able was I ere I saw Elba. This last one is
attributed to Napoleon, though it is doubtful that he knew enough English to form
it.
Once the leftmost digit is chosen, the last digit must be identical to it, so we have
9
1.
There are 10 choices for the second digit from the left
9 10
1.
Once this digit is chosen, the second digit from the right must be identical to it,
so we have only 1 choice for it,
9 10 1
1.
Finally, there are 10 choices for the third digit from the right,
9 10 10 1 1 ,
which give us 900 palindromes of 5-digits.
Example 6.8 How many palindromes of 5 digits are even?
Solution: A five digit even palindrome has the form ABCBA, where A belongs to
{2, 4, 6, 8}, and B, C belong to {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. Thus there are 4
choices for the first digit, 10 for the second, and 10 for the third. Once these
digits are chosen, the palindrome is completely determined. Therefore, there are
4 10 10 = 400 even palindromes of 5 digits.
Example 6.9 How many positive divisors does 300 have?
2 2
a b c
We now prove that if a set A has n elements, then it has 2 subsets. To motivate
the proof, consider the set {a, b, c}. To each element we attach a binary code of
length 3. We write 0 if a particular element is not in the set and 1 if it is. We then
have the following associations:
000,
{a, b} 110,
{a} 100,
{a, c} 101,
{b} 010,
{c} 001,
{b, c} 011,
{a, b, c} 111.
Case I: D1+D2+D3+D4 = 6. Here we have {D1, D2, D3, D4} = {0, 1, 2, 3, 4}, D1 6=
0. There are then 3 choices for D 1. After D1 is chosen, D2 can be chosen in 3
ways, D3 in 2 ways, and D1 in 1 way. There are thus 3 3 2 1 = 3 3! = 18
integers satisfying case I.
Case II: D1 +D2 +D3 +D4 = 9. Here we have {D1, D2, D3, D4} = {0, 2, 3, 4}, D 1 6=
0 or {D1, D2, D3, D4} = {0, 1, 3, 5}, D1 6= 0. Like before, there are 3 3! = 18
numbers in each possibility, thus we have 2 18 = 36 numbers in case II.
Case III: D1+D2+D3+D4 = 12. Here we have {D1, D2, D3, D4} = {0, 3, 4, 5}, D1 6= 0 or
{D1, D2, D3, D4 } = {1, 2, 4, 5}. In the first possibility there are 33! = 18 numbers, and in
the second there are 4! = 24. Thus we have 18 + 24 = 42 numbers in case III.
3 3
Solution: Observe that 1000 = 2 5 , and thus from the 1000 integers we must weed
out those that have a factor of 2 or of 5 in their prime factorization. If A 2 denotes the
set of those integers divisible by 2 in the interval [1, 1000] then clearly
1000
2c = 500. Similarly, if A5 denotes the set of those integers divisible
1000
1000 c = 100. This
by 5 then card (A5) = b 5 c = 200. Also card (A2 A5) = b 10
means that there are card (A 2 A5) =500 + 200 100 = 600 integers in the interval
[1, 1000] sharing at least a factor with 1000, thus there are 1000 600 = 400
integers in [1, 1000] that do not share a factor prime factor with 1000.
card (A2) = b
A) + card (A B C)
Proof 1. Using the associativity and distributivity of unions of sets, we see that
card (A B C) = card (A (B C))
= card (A) + card (B C) card (A (B C))
= card (A) + card (B C) card ((A B) (A C))
= card (A) + card (B) + card (C) card (B C) card (A B)
card (A C)
+ card ((A B) (A C))
= card (A) + card (B) + card (C) card (B C)
(card (A B) + card (A C) card (A B C))
= card (A) + card (B) + card (C)
card (A B) card (B C) card (C A)
+ card (A B C) .
This gives the Inclusion-Exclusion Formula for three sets.
Proof 2. Construct a Venn Diagram.
Example 7.3 How many integers between 1 and 600 inclusive are not divisible
by 3, 5, or 7?
Solution: Let Ak denote the set of integers between 1 and 600 which are divisible
by k. Then
card (A3)
card (A5)
600
3c = 200,
600
5c = 120,
card (A7)
card (A15)
card (A21)
card (A35)
card (A105)
600
600
600
600
7c = 85,
15c = 40
21c = 28
35c = 17
600
105c = 5
= 1,
2! = 1 2 = 2,
3! = 1 2 3 = 6,
4! = 1 2 3 4 = 24,
5!
= 1 2 3 4 5 = 120.
4! (n
n! (n
2)!
(n + 1)!
=
=
7 6 5 4! = 210, 4!
(n + 2)(n + 1)n!
= (n + 2)(n + 1), n!
(n 2)!
(n + 1)(n)(n 1)
M HT A
AHT M
T HM A
HMT A
M HAT
AHM T
T HAM
HM AT
Theorem 8.1 Permutations. Let x1, x2, . . . , xn be n distinct objects. Then there
are n! permutations of them.
Proof. The first position can be chosen in n ways, the second object in n 1
ways, the third in n 2, etc. This gives
n(n 1)(n 2) 2 1 = n!.
Example 8.4 The number of permutations of the letters of the word RET ICULA
is 8! = 40320.
Example 8.5 A bookshelf contains 5 German books, 7 Spanish books and 8
French books. Each book is dierent from one another.
(a) How many dierent arrangements can be made of these books?
(b) How many dierent arrangements can be made of these books if books of
each language must be next to each other?
(c) How many dierent arrangements can be made of these books if all the
French books must be next to each other?
(d) How many dierent arrangements can be made of these books if no two
French books can be next to each other?
Solution:
(a) We are permuting 5 + 7 + 8 = 20 objects. Thus the number of arrangements
sought is 20! = 2432902008176640000.
(b) Glue the books by language, this will assure that books of the same language
are together. We permute the 3 languages in 3! ways. We permute the German
books in 5! ways, the Spanish books in 7! ways and the French books in 8!
ways. Hence the total number of ways is 3!5!7!8! = 146313216000.
(c) Align the German books and the Spanish books first. Putting these 5 + 7 = 12
books creates 12 + 1 = 13 spaces (we count the space before the first book, the
spaces between books and the space after the last book). To assure that all the
French books are next each other, we glue them together and put them in
one of these spaces. Now, the French books can be permuted in 8! ways
and the non-French books can be permuted in 12! ways. Thus the total
number of permutations is
(13)8!12! = 251073478656000.
(d) Align the German books and the Spanish books first. Putting these 5 + 7 = 12
books creates 12 + 1 = 13 spaces (we count the space before the first book, the
spaces between books and the space after the last book). To assure that no two
French books are next to each other, we put them into these spaces. The first
French book can be put into any of 13 spaces, the second into any of 12, etc., the
eighth French book can be put into any 6 spaces. Now, the non-French books can
be permuted in 12! ways. Thus the total number of permutations is
(13)(12)(11)(10)(9)(8)(7)(6)12!,
which is 24856274386944000.
2!4!2!
13!
= 64864800.
Solution: The particle M ASS can be considered as one block and the 9 letters
A, C, H, U, S, E, T, T, S. In A, C, H, U, S, E, T, T, S there are four Ss and two T s
and so the total number of permutations sought is
2!2!
10!
= 907200.
Example 8.8 In how many ways may we write the number 9 as the sum of three
positive integer summands? Here order counts, so, for example, 1 + 7 + 1 is to
be regarded dierent from 7 + 1 + 1.
Solution: We first look for answers with
a + b + c = 9, 1 a b c 7
,
R ,
R .
In the first case there are 2! = 2 ways of putting the remaining M and U. In the
second case, there are 2! = 2 ways, and in the third case there is only 1! = 1
way. Thus, starting the word with MU gives 2 + 2 + 1 = 5 possible arrangements.
In the general case, we can choose the first letter of the word in 3 ways, and the
second in 2 ways. Thus the number of arrangements sought is 3 2 5 = 30.
8.3 Combinations without Repetitions
Definition 8.3 Let n, k be non-negative integers with 0 k n. The symbol
n
k
Remark. Observe that in the last fraction, there are k factors in both the numerator
and denominator. Also, observe the boundary conditions
= 1,
n 1 = n.
0 =
n
1 =
n
n
n
n
= 1 2 3 = 20,
6 5 4
2
11
= 55,
11 10
7
12
2 3 4 5 6 7 = 792,
12 11 10 9 8 7 6
109 =
110
110,
0
110
= 1,
1
110
= 110.
= k!(n
(n
k)!(n
! (n
k))!
n k .
n
This can be interpreted as follows: if there are n di erent tickets in a hat, choosing k
of them out of the hat is the same as choosing n k of them to remain in the hat.
Example 8.11
9
11
5
12
2
11
= 7
12
= 55,
= 792.
n
objects is k .
Proof. Pick any of the k objects. This can be done in n(n 1)(n 2) (n k +
1) ways, since there are n ways of choosing the first, n 1 ways of choosing the
second, etc. This particular choice of k objects can be permuted in k! ways.
Hence the total number of k-combinations is
( 1)(
nn
k!
2)
(n
k + 1)
4 = 210 ways.
Example 8.15 In a group of 2 camels, 3 goats, and 10 sheep in how many ways
can we choose a committee of 6 animals if
(a) there are no constraints in species?
(b) the two camels must be included?
(c) the two camels must be excluded?
(d) there must be at least 3 sheep?
(e) there must be at most 2 sheep?
(f) Joe Camel, Billy Goat and Samuel Sheep hate each other and they will not
work in the same group. How many compatible committees are there?
Solution:
(a) There are 2 + 3 + 10 = 15 animals and we must choose 6. Thus, there are
6 = 5005
15
possible committees.
(b) Since the 2 camels are included, we must choose 6 2 = 4 more animals
from a list of 15 2 = 13 animals, so there are
13
= 715
4
possible committees.
(c) Since the 2 camels must be excluded, we must choose 6 animals from a list of
15 2 = 13, so there are
13
= 1716
possible committees.
(d) If k sheep are chosen from the 10 sheep, 6 k animals must be chosen from the remaining 5
animals, so there are
3
3 +
4 2 +
5 1 +
6 0 = 4770
10
5
10
5
10 5
10 5
possible committees.
(e) First observe that there cannot be 0 sheep, since that would mean choosing 6 other animals.
Hence, there must be either 1 or 2 sheep, and so 3 or 4 of the
other animals. The total number is thus
2
10
10
= 235.
(f) A compatible group will either exclude all these three animals or include exactly one of them.
This can be done in
6+
12
12
= 3300
ways.
Example 8.16 Consider the set of 5-digit positive integers written in decimal no-tation.
(a) How many are there?
(b) How many do not have a 9 in their decimal representation?
(c) How many have at least one 9 in their decimal representation?
(d) How many have exactly one 9?
(e) How many have exactly two 9s?
(f) How many have exactly three 9s?
(g) How many have exactly four 9s?
(h) How many have exactly five 9s?
(i) How many have neither an 8 nor a 9 in their decimal representation?
(j) How many have neither a 7, nor an 8, nor a 9 in their decimal representation?
(f) Again we condition on the first digit. If the first digit is a 9 then two of the
4
remaining four must be 9s, and the choice of place can be accomplished in 2
2
= 6 ways. The other two remaining digits must be di erent from 9, giving 6 9
= 486 such numbers. If the first digit is not a 9, then there are 8 choices for this
4
first digit. Also, we have 3 = 4 ways of choosing were the three 9s will be, and
we have 9 ways of filling the remaining spot. Thus in this case there
are 8 4 9 = 288 such numbers. Altogether there are 486 + 288 = 774 fivedigit positive integers with exactly three 9s in their decimal representation.
(g) If the first digit is a 9 then three of the remaining four must be 9s, and the
4
choice of place can be accomplished in 3 = 4 ways. The other remaining digit
must be dierent from 9, giving 4 9 = 36 such numbers. If the first digit is not a
4
9, then there are 8 choices for this first digit. Also, we have 4 = 4 ways of
choosing were the four 9s will be, thus filling all the spots. Thus in this case
there are 8 1 = 8 such numbers. Altogether there are 36 + 8 = 44 five-digit
positive integers with exactly three 9s in their decimal representation.
(h) There is obviously only 1 such positive integer.
Remark. Observe that 37512 = 29889 + 6804 + 774 + 44 + 1.
(i) We have 7 choices for the first digit and 8 choices for the remaining 4 digits,
4
1
1.
Proof. Write n as
n = 1 + 1 + + 1 + 1,
where there are n 1s and n 1 plus signs. To decompose n in r summands we
need to choose r 1 plus signs from the n 1, which proves the theorem.
Example 8.17 In how many ways may we write the number 9 as the sum of
three positive integer summands? Here order counts, so, for example, 1 + 7 + 1
is to be regarded dierent from 7 + 1 + 1.
Solution: We are seeking integral solutions to
a + b + c = 9, a > 0, b > 0, c > 0.
The number of solutions is thus
1 =
9
1
2 = 28.
Example 8.18 In how many ways can 100 be written as the sum of four positive
integer summands?
Solution: We want the number of positive integer solutions to
a + b + c + d = 100,
which is
99
3
= 156849.
r1
Proof. Set xr 1 = yr. Then xr 1. The equation
x1 1 + x2 1 + + xr 1 = n
is equivalent to
x1 + x2 + + xr = n + r,
which has
n+r1r
1
solutions.
Example 8.19 Find the number of quadruples (a, b, c, d) of integers satisfying
a + b + c + d = 100, a 30, b > 21, c 1, d 1.
0
Example 8.20 There are five people in a lift of a building having eight floors. In
how many ways can they choose their floor for exiting the lift?
Solution: Let xi be the number of people that floor i receives. We are looking for
non-negative solutions of the equation
x1 + x2 + + x8 = 5.
Setting yi = xi + 1, then
x1 + x2 + + x8 = 5 = (y1 1) + (y2 1) + + (y8 1) = 5 =
y1 + y2 + + y8 = 13,
12
= 792.
which is
4 .
Example 8.22 How many integral solutions to the equation
a + b + c + d = 100,
are there given the following constraints:
1 a 10, b 0, c 2, 20 d 30?
Solution: We use Inclusion-Exclusion. There are
80
3
a + b + c + d = 100, a 1, b 0, c 2, d 20.
Let A be the set of solutions with
a 11, b 0, c 2, d 20
and B be the set of solutions with
a 1, b 0, c 2, d 31.
Then card (A) =
70
3 , card (B)
card (A B) =
69
3
, card (A B) =
3+
70
69
59
59
and so
= 74625.
80
70
69
59
= 7535.
10
Probability
12
ordinary playing cards is
52.
Example 10.2 Find the probability that when two cards are randomly drawn,
with-out replacing the first card, at least one of the cards is a face card.
Solution: We must consider the following three cases separately:
Case 1: The first card is a face card and the second card is not a face card.
This can happen in 12 40 dierent ways.
Case 2: The first card is a not a face card and the second card is a face
card. This can happen in 40 12 dierent ways.
Case 3: Both cards are face cards. This can happen in 12 11 di erent ways.
Thus, the total number of ways in which at least one of the cards can be a face
card is 12 40 + 40 12 + 12 11 = 1092. The total number of ways to draw two
cards (without replacing the first) is 52 51. Thus, the probability that at least
one of the cards is a face card is
1092
7
P = 52 51 = 17 .
Theorem 10.1 We can obtain some basic results about probabilities directly from
the definition. Let P (A) denote the probability that event A occurs.
0 P (A) 1.
If A and B are two independent events (i.e. events which do not a ect each
others outcomes), then
P (A B) = P (A) P (B).
Example 10.3 Find the probability that a king or a heart is drawn when choosing
one card from an ordinary deck of 52 cards.
Solution:
P (heart or king) = P (heart) + P (king) P (heart and king)
4
1
52 + 52 52
16
=
52
4
= 13 .
=
13
Example 10.4 (2003 AMC 10B #21) A bag contains two red beads and two
green beads. Reach into the bag and pull out a bead, replacing it with a red
bead regardless of the color. What is the probability that all the beads are red
after three such replacements?
(A) 1/8
(B) 5/32
(C) 9/32
(D) 3/8
(E) 7/16
Solution: For all the beads to be red after three replacements, two of the three
beads chosen must have been green. Thus, the selections must have been one
of the following:
Case 1: red, green, green. The probability of this case is
1 1
1
2 2 4 = 16 .
3 1
3
2 4 4 = 32 .
1
1
2 2 1 = 8.
1
3 1
9
16 + 32 + 8 = 32 .
Example 10.5 (2004 AMC 10A #10) Coin A is flipped three times and coin B is
flipped four times. What is the probability that the number of heads obtained
from flipping the two fair coins is the same?
(A) 19/128
(B) 23/128
(C) 1/4
(D) 35/128
(E) 1/2
2 2 = 2
The probability that we obtain exactly 1 head with both coins is
3
3 12 4
12
= 12 12
12
= 18 12
2 4 2 =4
Thus, the desired probability is
(1 + 12 + 18 + 4) 12
= 128
35
Example 10.6 The Monty Hall Problem. Consider the following game. Three boxes
are marked A, B, and C, and one of them contains $1,000,000. You choose box C.
Im going to help you out now. I tell you that box A does not contain the money. Now,
you decide whether you want to change and choose box B, or keep box
C.
Solution: At first glance, you might say that the money is equally likely to be in box B
or C, so changing doesnt help at all. However, consider the probability of winning
this game. If you never change, the only way that you win is if you choose the right
box first, a 1/3 chance. If you change instead, you will always win if you pick a
wrong box first, because after I expose one wrong box, the other unchosen box is a
winner. Since you have a 2/3 chance of picking the wrong box initially, you have a
2/3 chance of winning if you accept the o er to switch boxes.
11
Statistics
Most of the AMC statistics problems involve the concepts of mean (average),
median, and mode.
Definition 11.1 The (arithmetic) mean of a collection of n numbers a 1, a2, . . . , an
is
a +a + +a
n.n
mean = 1 2
(B) 112.5
(C) 120
(D) 125
(E) 150
Solution: Let S denote the number of seniors that participated in the contest.
Then the number of non-seniors that participated in the contest is 1.5S, and
S + 1.5S = 100, so S = 40.
Thus there are 40 seniors and 60 non-seniors that participated in the contest.
2
Let M be the mean of the seniors. Then the mean of the non-seniors is 3 M. The
sum of the seniors scores is 40M and the sum of the non-seniors scores is 60
2
3 M = 40M. Thus, we obtain
100 = 40M + 40M ,
so
100
M = 125.
5
Example 11.2 (2004 AMC 12A #10) The sum of 49 consecutive integers is 7 .
What is their median?
(A) 7
(B) 7
(C) 7
(D) 7
(E) 7
Solution. Since the integers are consecutive, the mean and the median are the
same with value
median = mean =
75
75
=
49 72
= 73.
Example 11.3 (2000 AMC 12 #9) Mrs. Walter gave an exam in a mathematics
class of five students. She entered the scores in random order onto a
spreadsheet, which recalculated the class average after each score was
entered. Mrs. Walter noticed that after each score was entered, the average was
always an integer. The scores (listed in ascending order) were 71, 76, 80, 82,
and 91. What was the last score Mrs. Walter entered?
(A) 71
(B) 76
(C) 80
(D) 82
(E) 91
Solution: Since the average of the first two scores entered is an integer, the first two
scores entered must both be even or both be odd. If they were the two odd scores, then
their sum would be 71 + 91 = 162. Since 162 is divisible by 3, the third score added
would also have to be divisible by 3 so that the average of the first three scores is an
integer. However, none of the remaining scores (76, 80, and 82) is divisible by 3, so the
first two scores that she entered could not have been the odd scores.
Thus, the first two scores entered must have both been even. Since
76 + 80 = 156 and 80 + 82 = 162
are both divisible by 3, but none of 71, 91, and 82 is divisible by 3, the first pair
chosen could not have been 76 and 80 or 80 and 82. Thus, the first two scores
entered must have been 76 and 82. Since 76 + 82 = 158 has a remainder of 2
when divided by 3, the third score entered must have a remainder of 1 when
divided by 3. Of those remaining, only 91 has this property. So the first three
scores entered must have been 76, 82, and 91. Since the sum of 76, 82, and 91
is odd, the fourth score entered must also be odd. Thus, the fourth score
entered was 71 and the last score entered was 80.
12
a1 + a2 + a3 + + an = 2 (a1 + an).
n1
Theorem 12.2 If {an} is a geometric sequence with first term a and common ratio
r, then
1r
a +a + +a =a
1
1r
Sn =
a1 + a2 + a3 + + an
2
n1
= a + ar + ar + + ar
2
3
n
rSn = ar + ar + ar + + ar
n
Sn rSn = a ar .
Definition 12.4 A recursively-defined sequence is one in which the n-th term a n is
defined in terms of the previous terms a1, a2, . . . , an1.
Example 12.4 The Fibonacci sequence is an example of a recursively-defined
se-quence:
fn = fn1 + fn2, f1 = 0, f2 = 1.
The first few terms of the Fibonacci sequence are 0,1,1,2,3,5,8,13,....
Example 12.5 (2002 AMC 12B #13) The sum of 18 consecutive positive integers
is a perfect square. What is the smallest possible value of this sum?
(A) 169
(B) 225
(C) 289
(D) 361
(E) 441
Solution: Let a denote the first term of the sequence. The sequence is an
arithmetic sequence with d = 1, and the sum is
18
For the sum to be a perfect square, the term 2a + 17 must be a perfect square.
This first occurs when a = 4, which gives the sum 225.
Example 12.6 (1981 AHSME #14) In a geometric sequence of real numbers, the
sum of the first two terms is 7 and the sum of the first six terms is 91. What is
the sum of the first four terms?
(A) 28
(B) 32
(C) 35
(D) 49
(E) 84
Solution: Let a denote the first term of the sequence and let r denote the common
ratio. We have
2
4
7 = a + ar and 91 = 7(1 + r + r ).
a1 = 1, and
(A) 1
99
(B) 2
(C) 2
100
(D) 2
4950
a21 = 1 a1 = 1 = 2
a22 = a4 = a22 = 2 a2 = 2 = 2
1+2
a23 = a8 = a24 = 4 a4 = 8 = 2
a24 =
a16 = a28 = 8 a8 = 64 = 2
4950
1+2+3
(E) 29999
13
Prime Factorization
Definition 13.1 A natural number greater than 1 is said to be prime if its only
natural number divisors are 1 and itself. Natural numbers greater than 1 that are
not prime are composite.
Theorem 13.1 The Fundamental Theorem of Arithmetic. Every natural number,
other than 1, can be factored into a product of primes in only one way, apart
from the order of the factors.
Example 13.1 Find positive integers x and y that satisfy both
xy = 40 and 31 = 2x + 3y.
3
Solution: Since 40 has the unique factorization 40 = 2 5, there are only 8 possibilities for the pair (x, y). These are (1, 40), (2, 20), (4, 10), (8, 5), (5, 8), (10, 4), (20, 2),
(40, 1). Only (x, y) = (8, 5) additionally satisfies 31 = 2x + 3y.
Example 13.2 (1998 AHSME #6) Suppose that 1998 is written as a product of two
positive integers whose dierence is as small as possible. What is this di erence?
(A) 8
(B) 15
(C) 17
(D) 47
(E) 93
3
(B) 3
(C) 4
8
(D) 5
4
(E) 6
(A) 4
(B) 6
(C) 8
(D) 10
(E) 12
ab + a + b + 1 = 525 = (a + 1)(b + 1) = 3 5 7
2
bc + b + c + 1 = 147 = (b + 1)(c + 1) = 3 7
cd + c + d + 1 = 105 = (c + 1)(d + 1) = 3 5 7.
2
a1 b c
3 5
a b1 c
n/3 = 2 3
a b c1
n/5 = 2 3 5
Since n/2 must be a perfect square, a 1, b, and c must all be even. Since n/3
is a perfect cube, a, b 1, and c must all be multiples of 3. Since n/5 is a perfect
fifth power, a, b, and c 1 must all be multiples of 5. The smallest values that
15 10 6
satisfy these conditions are a = 15, b = 10, and c = 6. Thus, n = 2 3 5 is the
smallest such positive integer.
Example 13.6 Show that log10 2 is irrational.
Solution: If log10 2 is rational, then there exist integers r, s such that
r
log 2 = .
10
s
Then
10
r/s
= 2,
so
r
10 = 2 ,
or
r r
52 =2 ,
which contradicts the FTA. Thus, log10 2 is irrational.
8
11
+2 is a perfect square.
11
k =2 +2
+ 2 = 2304 + 2 = 48 + 2 .
Then
n
k 48 = (k 48)(k + 48) = 2 .
By the FTA,
s
k 48 = 2 and k + 48 = 2 ,
where s + t = n. But then
t
2 2 = 48 (48) = 96 = 3 2 ,
so
s
2 (2
ts
1) = 3 2 .
14
Number Bases
14.1
n = a010 + a110
k1
+ a210
k2
+ + ak110 + ak
65789 = 6 10 + 5 10 + 7 10 + 8 10 + 9.
Example 14.1 Find a reduced fraction equivalent to the repeating decimal 0.123
= 0.123123123 . . . .
Solution: Let N = 0.123123123 . . . . Then 1000N = 123.123123123 . . . . Hence
1000N N = 123, so
N=
123
999 = 333
41
Example 14.2 What are all the two-digit positive integers in which the di erence
between the integer and the product of its two digits is 12?
Solution: Let such an integer be 10a+b, where a, b are digits. Solving 10a+bab
= 12 for a, we obtain
2 .
a = 12 b = 1 +
10 b
10 b
Since a is an integer, 10 b must be a positive integer that divides 2. This gives
b = 8, a = 2 or b = 9, a = 3. Thus, 28 and 39 are the only such integers.
Example 14.3 Find all the integers with initial digit 6 such that if this initial integer
is suppressed, the resulting number is 1/25 of the original number.
n
y = 25 (6 10 + y) ,
that is,
y=
10
n
n2
4 = 25 10 .
This requires n 2, whence y = 25, 250, 2500, 25000, etc.. Therefore x = 625, 6250, 62500,
625000, etc..
Example 14.4 (1986 IMO) Find all natural numbers x such that the product of
2
with 0 a, b, c 4, i.e., five possible digits. There are 5 = 125 integers of the
2
form 1000 + 100a + 10b + c, 0 a, b, c 4, 5 = 25 integers of the form 1000 +
100a + 10b + 9, 0 a, b 4, and 5 integers of the form 1000 + 100a + 99, 0 a
4. The total of integers sought is thus 125 + 25 + 5 + 1 = 156.
Example 14.7 (1992 AIME) Let S be the set of all rational numbers r, 0 < r < 1,
that have a repeating decimal expansion of the form
0.abcabcabc . . . = 0.abc,
where the digits a, b, c are not necessarily distinct. To write the elements of S as
fractions in lowest terms, how many dierent numerators are required?
abc
999
999 999
3 + 37
999
3 37 = 648
s+
such fractions. Also, fractions of the form 37 where s is divisible by 3 but not by
37 are in S. There are 12 fractions of this kind (with s = 3, 6, 9, 12, . . . , 36). We
l
because these fractions are > 1 and hence not in S. The total number of distinct
numerators in the set of reduced fractions is thus 640 + 12 = 660.
k+1
We use the convention that we shall refer to a decimal number (i.e. a base-10 number)
without referring to its base, and to a base-r number by using the subindex r.
Definition 14.1 We will refer to the base-2 representation of a number as the binary form of the number. We will refer to the base-3 representation of a number
as the ternary form of the number.
Example 14.8 Express the decimal number 5213 in base-7.
5
Thus,
3
5213 = 2 7 + 1 7 + 1 7 + 2 7 + 5 = 211257.
Example 14.9 Rewrite the base-6 number 3425 6 in base 8.
Solution: First, we rewrite the base-6 number 3425 6 in base-10 representation:
3
34256 = 3 6 + 4 6 + 2 6 + 5
= 809.
2
809
3
= 1 8 + +4 8 + 5 8 + 3
=
14538.
289 = 2 5 + 1 5 + 2 5 + 4,
so
5627 = 289 = 21245.
Example 14.11 (1981 AHSME #16) The base-3 representation of x is
121122111222111122223.
What is the first digit (on the left) of the base-9 representation of x?
(A) 1
(B) 2
(C) 3
(D) 4
(E) 5
Solution: Since 9 = 3 , we will group the base-3 digits in pairs, starting from the
right. Then
x = (12)(11)(22)(11)(12)(22)(11)(11)(22)(22)3
18
16
14
12
= (1 3 + 2) 3 + (1 3 + 1) 3 + (2 3 + 2) 3 + (1 3 + 1) 3
10
8
6
4
+(1 3 + 2) 3 + (2 3 + 2) 3 + (1 3 + 1) 3 + (1 3 + 1) 3
2
+(2 3 + 2) 3 + (2 3 + 2)
8
7
6
5
4
3
2
1
= 59 +49 +89 +49 +59 +49 +49 +89 +8
=
54845844889.
15
Modular Arithmetic
Definition 15.1 Given a positive integer n, we say that the integer a is equal to
the integer b modulo n, written
a b mod n
if n divides a b. Equivalently, a b mod n if b is the remainder that results
when a is divided by n.
For example,
37 2 mod 5 and 9 1 mod 4.
Note also that
11 4
mod 3
since 11 4 = 15 is divisible by 3.
Since n|(a b) implies that there is an integer k such that nk = a b, we deduce
that a b mod n if and only if there is an integer k such that a = b + nk.
Theorem 15.1 Let n 2 be an integer. If x y mod n and u v mod n then
ax + bu ay + bv mod n.
Proof. Since n|(x y) and n |(u v), there are integers s and t such that ns = x
y and nt = u v. This implies that
a(x y) + b(u v) = n(as + bt),
which in turn implies that
n|(ax + bu ay bv).
Thus
ax + bu ay + bv mod n.
mod n.
Corollary 15.3 Let n > 1 be an integer, x y mod n and j a positive integer. Then
j
x y mod n.
Proof. Use Corollary 15.2 repeatedly with u = x, v = y.
Corollary 15.4 Let n > 1 be an integer, x y mod n. If f is a polynomial with
integral coecients then f(x) f(y) mod n.
Example 15.1 Find the units digit of 7
Solution: To find the units digit of 7
100
100
, we must find 7
72 1
3
74
100
7
100
100
modulo 10.
mod 10
2
77
mod 10
7
mod 10
22
(7 )
mod 10
2
(1) mod 10
1 mod 10
4 25
(7 )
mod 10
25
1
mod 10
1 mod 10.
is 1.
1987
is divided by 37.
1986
2 993
6
66
6(6 )
and the remainder sought is 31.
6(1)
993
6 31 mod 37
is divided by 4.
Solution:12233 = 12200 + 32 + 1 1 mod 4. Similarly, 455679 = 455600 + 76 + 3
3, 87653 = 87600 + 52 + 1 1 mod 4. Thus
3
2n+1
n+2
+2
2n+1
39 32
mod 7
and
2
n+2
42
mod 7
. Hence
2n+1
3
for all natural numbers n.
+2
n+2
72 0
mod 7,
32
28
7 4
5 2
yield
2 2
32
which means that 641|(2 + 1).
Example 15.6 Prove that 7|(2222
28
5555
mod 641
mod 641,
+ 5555
2222
).
5
77
mod 7.
2
7
7
3 mod 10 and 7
(7 )
1 mod 10. Also, 7
1 mod 4 and so 7
(7 ) 7 3 mod 4, which means that there is an integer t such that 7 = 3 + 4t.
Upon assembling all this,
77
4t+3
7 7
Thus the last digit is 3.
4t
(7 ) 7 1 3 3 mod 10.
n
Solution:
Observe that 2 2, 2 4, 2 1, 2 3k
2, 2 4, 2 1 mod 7 and so
3k
2 1 mod 3 for all positive integers k. Hence 2 + 27 1 + 27 0 mod 7 for
all positive integers k. This produces the infinitely many values sought.
k
3k 1, k = 1, 2, . . .
produces the terms
2
n 1 = (3k 1) 1 = 3, 24, . . . ,
which are the terms at odd places of the sequence 3, 15, 24, 48, . . .. We must
find the 997th term of the sequence 3k + 1, k = 1, 2, . . .. Thus, the term sought
2
2
2
is (3(997) + 1) 1 (3(3) + 1) 1 8 1 63 mod 1000. The remainder
sought is thus 63.
Example 15.11 Find the remainder when 3
2006
is divided by 8.
32006
1003
32
1003
mod 8
1
mod 8
1 mod 8.
Thus, the remainder is 1.
Example 15.12 Find the remainder when 3
2006
is divided by 11.
2005
35
401
1401
3
mod 11
3 mod 11
3 mod 11
mod 11.
a 2 a 3 a 4 a 5 a 6 a 7
7 = 2! + 3! + 4! + 5! + 6! + 7! ,
(B) 9
(C) 10
(D) 11
(E) 12
Solution: First, multiply both sides of the equation by 7! to clear the denominators:
5 6! = a2(7 6 5 4 3) + a3(7 6 5 4) + a4(7 6 5) + a5(7 6) + a6 +a7.
mod 7.
Solution: An integer is either even (of the form 2k) or odd (of the form 2k + 1).
We have
2
(2k) =
2
(2k + 1) =
4(k ),
2
4(k + k) + 1.
Thus squares leave remainder 0 or 1 when divided by 4 and hence their sum
leave remainder 0, 1, or 2.
Example 15.15 Prove that 2003 is not the sum of two squares by proving that
the sum of any two squares cannot leave remainder 3 upon division by 4.
Solution: 2003 leaves remainder 3 upon division by 4. But we know from
example 15.14 that sums of squares do not leave remainder 3 upon division by
4, so it is impossible to write 2003 as the sum of squares.
16
n is divisible by 7 if and only if 7 divides the integer that results from first
truncating n by removing its units digit, and then subtracting twice the value
of this digit from the truncated integer.
Proof.
n = ak 10 + ak110
k1
+ + a2 10 + a1 10 + a0.
j
mod 11,
10 (1)
mod 11.
Finally, well consider the divisibility by 7 results. First, we can show that the
result is always true provided that it is true for all integers with at most 6
digits, i.e. when
5
n = a5 10 + a4 10 + a3 10 + a2 10 + a1 10 + a0.
2
n1 = a5 10 + a4 10 + a3 10 + a2 10 + a1 2a0.
To see that 7 also divides n1 if and only if b = 0, note that
n1 (4a5 + 6a4 + 2a3 + 3a2 + a1) mod 7
(4a5 + 6a4 + 2a3 + 3a2 + a1 2b + 2(5a5 + 4a4 + 6a3 + 2a2 + 3a1) mod 7
14a5 + 14a4 + 14a3 + 7a2 + 7a1 2b mod 7
2b mod 7.
17
S2 = {2, 98}, S3 = {3, 97}, . . . , S k = {k, 100 k}, . . . , S 49 = {49, 51}, S50 = {50}.
Let S1, S2, . . . , S50 be the pigeonholes, and a1, a2, . . . , a51 the pigeons. Since
there are 51 pigeons and 50 pigeonholes, there must be at least one pigeonhole
with more than one pigeon. Thus, there must be at least one S i with two
numbers in it. Their sum is 100.
Example 17.3 Show that amongst any seven distinct positive integers not
exceeding 126, one can find two of them, say a and b, which satisfy
b < a 2b.
Solution: Split the numbers {1, 2, 3, . . . , 126} into the six sets
{1, 2}, {3, 4, 5, 6}, {7, 8, . . . , 13, 14}, {15, 16, . . . , 29, 30},
{31, 32, . . . , 61, 62} and {63, 64, . . . , 126}.
By the Pigeonhole Principle, two of the seven numbers must lie in one of the six
sets, and obviously, any such two will satisfy the stated inequality.
Example 17.4 Show that amongst any 55 integers from
{1, 2, . . . , 100},
two must dier by 10.
Solution: First observe that if we choose n + 1 integers from any string of 2n
consecutive integers, there will always be some two that di er by n. This is
because we can pair the 2n consecutive integers
{a + 1, a + 2, a + 3, . . . , a + 2n}
into the n pairs
{a + 1, a + n + 1}, {a + 2, a + n + 2}, . . . , {a + n, a + 2n},
and if n + 1 integers are chosen from this, there must be two that belong to the
same group.
So now group the one hundred integers as follows:
{1, 2, . . . 20}, {21, 22, . . . , 40},
{41, 42, . . . , 60}, {61, 62, . . . , 80}
and
{81, 82, . . . , 100}.
If we select fifty five integers, we must perforce choose eleven from some group.
From that group, by the above observation (let n = 10), there must be two that
dier by 10.
Example 17.5 (1978 Putnam) Let A be any set of twenty integers chosen from
the arithmetic progression 1, 4, . . . , 100. Prove that there must be two distinct
integers in A whose sum is 104.
Solution: We partition the thirty four elements of this progression into nineteen
groups
{1}, {52}, {4, 100}, {7, 97}, {10, 94}, . . . , {49, 55}.
Since we are choosing twenty integers and we have nineteen sets, by the
Pigeonhole Principle there must be two integers that belong to one of the pairs,
which add to 104.
Example 17.6 (1964 IMO) Seventeen people correspond by mail with one another
each one with all the rest. In their letters only three di erent topics are discussed.
Each pair of correspondents deals with only one of these topics. Prove that there at
least three people who write to each other about the same topic.
Solution: Choose a particular person of the group, say Charlie. He corresponds with
sixteen others. By the Pigeonhole Principle, Charlie must write to at least six of the
people of one topic, say topic I. If any pair of these six people corresponds on topic
I, then Charlie and this pair do the trick, and we are done. Otherwise, these six
correspond amongst themselves only on topics II or III. Choose a particular person
from this group of six, say Eric. By the Pigeonhole Principle, there must be three of
the five remaining that correspond with Eric in one of the topics, say topic II. If
amongst these three there is a pair that corresponds with each other on topic II,
then Eric and this pair correspond on topic II, and we are done. Otherwise, these
three people only correspond with one another on topic III, and we are done again.
Example 17.7 Given any set of ten natural numbers between 1 and 99 inclusive,
prove that there are two disjoint nonempty subsets of the set with equal sums of
their elements.
10
Solution: There are 2 1 = 1023 non-empty subsets that one can form with a given 10element set. To each of these subsets we associate the sum of its elements. The
maximum value that any such sum can achieve is 90 + 91 + + 99 = 945 < 1023.
Therefore, there must be at least two dierent subsets S, T that have the same element
sum. Then S \ (S T ) and T \ (S T ) also have the same element sum.
Example 17.8 Given any 9 integers whose prime factors lie in the set {3, 7, 11}
prove that there must be two whose product is a square.
Solution: For an integer to be a square, all the exponents of its prime factorization must
a b c
be even. Any integer in the given set has a prime factorization of the form 3 7 11 . Now
each triplet (a, b, c) has one of the following 8 parity patterns: (even, even, even),
(even, even, odd), (even, odd, even), (even, odd, odd), (odd, even, even), (odd, even,
odd), (odd, odd, even), (odd, odd, odd). In a group of 9 such integers, there must be
two with the same parity patterns in the exponents. Take these two. Their product is a
square, since the sum of each corresponding exponent will be even.
Definition 17.1 A lattice point (m, n) on the plane is one having integer coordinates.
Definition 17.2 The midpoint of the line joining (x, y) to (x1, y1) is the point
x + x1 , y + y1
Example 17.9 Five lattice points are chosen at random. Prove that one can
always find two so that the midpoint of the line joining them is also a lattice point.
Solution: There are four parity patterns: (even, even), (even, odd), (odd, odd),
(odd, even). By the Pigeonhole Principle among five lattice points there must be
two having the same parity pattern. Choose these two. It is clear that their
midpoint is an integer.
Example 17.10 Prove that among n + 1 integers, there are always two whose
dif-ference is always divisible by n.
Solution: There are n possible dierent remainders when an integer is divided by
n, so among n + 1 dierent integers there must be two integers in the group
leaving the same remainder, and their dierence is divisible by n.