Escolar Documentos
Profissional Documentos
Cultura Documentos
Olympiads
IMOTC 2019
Sutanay Bhattacharya
2
Introduction
0.2 Prerequisites
I plan to start from ground zero, so I’ll assume basic knowledge of:
If you’re rusty with point 1, you can find the necessary resources anywhere from
your plus-two textbook to Wikipedia. There’s a nice resource on proof-writing;
see A Guide to Proof Writing, by Ron Morash. And if you’re unsure about
point 3, how did you make it this far?
i
ii
0.5 Credits
In addition to the above, I have taken several problems from various sources,
including IMO Shortlists, TSTs of various countries, Tournament of Towns,
Romanian Masters of Mathetics and various posts on Art of Problem Solving.
I couldn’t include the sources of each problem individually due to logistical
reasons; I’ll try to incorporate them in later versions of this note.
Chapter 1
The Groundwork
1.1 Introduction
In this chapter, we will attempt to sketch some of the basic ideas in number
theory. These include Euclid’s division algorithm, congruences, and Fermat’s
Little Theorem, and how to leave things as an exercise while writing handouts.
1
2 CHAPTER 1. THE GROUNDWORK
Well, now that we have proved that the good old long division actually
works, what can we do with that? One of the things that you probably did as a
kid in school was to find the GCD of two numbers by lots of long division. Now
let’s look into what it was really about.
Recall that GCD of two numbers a, b is the largest positive number dividing
both of them. Now how would you go about computing that? One interesting
observation is that gcd(a, b) = gcd(a − b, b) 1 . This gives us an way two reduce
the bigger number by exactly the smaller number. But why stop there? We can
decrease the larger number by b as long as we want, provided it stays positive.
And how long can we do that? As Euclid sayeth, we can decreases a exactly
q times, after which it becomes r, smaller than b. So we have successfully
reduced gcd(a, b) to gcd(r, b). But now b is the bigger number, so we can do
the same thing again to obtain gcd(r, r1 ). If we keep doing this, eventually one
of the numbers will become zero. At that point, we will have something like
gcd(rn , 0), and we all know that’s just rn .
We have just cooked up something interesting:
Fact 1.3.2. (Euclidean algorithm for GCD) If we have two numbers a, b and
we do long division enough times as prescribed above, we will eventually end
up with their GCD.
Now that we have a recipe for GCD, let’s formalize how it works. We are
given a, b, so we find q0 , r0 :
a = bq0 + r0
1 To see why, let the GCDs be d1 , d2 and prove that d1 |d2 , d2 |d1 .
1.4. PRIMETIME 3
Now r0 < b, sp we repeat that with the new pair of numbers and so on:
b = r0 q1 + r1
r0 = r1 q2 + r2
..
.
rk = rk+1 qk+2 + 0
So that rk+1 = g is the GCD. Now we look at the second last equation: rk−1 =
rk qk+1 + rk+1 which gives rk+1 = rk−1 − rk qk+1 . This expresses rk+1 as a linear
combination of two two preceding remainders. But rk−1 and rk are themselves
linear combination of the remainders before them, so if we substitute their
expressions, we can write rk+1 as a linear sum of the two remainders before
rk−1 . If we keep doing this, eventually we will end up with an expression of
rk+1 as linear sum of a, b, the very first “remainders”. Thus we’ve shown the
following:
Fact 1.3.3. (Bézout’s identity) If g = gcd(a, b), then we can find integers x, y
satisfying xa + yb = g.
Applied to the simple case when gcd(a, b) = 1, we see that there exist x, y
so that xa + yb = 1. This will later be important when we look at modular
inverses.
1.4 Primetime
Now we come to the prime 2 obsession of every number theorists.
Loosely speaking, primes are numbers that can’t be factored. But there are
other numbers like 420 and 69 that can be factored. But if we keep factoring
the factors themselves, we will eventually reach a point where we can no longer
continue; at that point, all factors are primes. Thus every positive number bigger
than 1 can be factored into primes. What’s more, this factoring is unique upto
reordering of the factors.
That right there, is a fairly deep and useful statement about number theory.
Why deal with plain old boring numbers, when you can build them with more
mysterious esoteric prime numbers? That aligns right with the general tendency
of number theory; so much so, that it’s called the Fundamental Theorem of
Arithmetic:
Fact 1.4.1. Every integer > 1 can be factored into primes uniquely (upto
reordering of those primes).
2 I’m not sorry.
4 CHAPTER 1. THE GROUNDWORK
Proving that a factoring exists is basically the argument we saw above; try
writing it up rigorously with induction. To prove uniqueness, we will need
another neat factoid:
Fact 1.4.2. (Euclid’s lemma) If p is a prime and p|ab, then p|a or p|b.
To see why, look at the GCD of p, a. Since it divides p it can only be p (in
which case we’re done) or 1, in which case, we can use Bézout to get x, y so
that xp + ya = 1 =⇒ xpb + yab = b. Now since p divides the left side, p|b.
Of course, this can generalized to as many factors as you want (do you see how?).
Now armed with this handy lemma, we are ready to prove uniqueness. Let
p1 p2 · · · pm = q1 q2 · · · qn be two representations of n. If some prime occurs on
both sides of that equation, simply cancel them out, so we can assume that some
of the factors on the left side occur on the right. But p1 |q1 · · · qn , so it divides
at least one of the qi ’s, which is impossible since qi is prime and distinct from p1 .
1. a ≡ a (mod n)
2. a ≡ b (mod n) =⇒ b ≡ a (mod n)
3. a ≡ b (mod n) and b ≡ c (mod n) =⇒ a ≡ c (mod n)
Using only these three properties, can you prove that Z can be partitioned
into subsets such two numbers are congruent modulo n if and only if they are
in the subset?
Not hard at all; especially if you know the magic word: pigeonhole principle.
Consider all the powers of a; by PHP, some two of them are same modulo n.
4 Proof of uniqueness is left to the reader, as usual.
6 CHAPTER 1. THE GROUNDWORK
Say n|ai − aj (with i > j). Then n|aj ai−j − 1 , and suing Euclid’s lemma and
that gcd(n, aj ) = 1, we are done.
So we now know that there is some power of a that’s 1 (mod n) (as a side-
note, do you see why this also implies Fact 1.5.4?). But as it turns out, we can
say more: we can a specific k depending on n so that ak is 1 (mod n) for all a
relatively prime to n. To see how that works, we’ll have to look a bit into the
multiplicative structure of the set of relevant residues here.
For simplicity, let’s say n = p, a prime number, so that it’s easier to keep
track of which a’s are relatively prime to n. Let’s look at the set of possible
residues for a modulo some prime, say 7:
S = {1, 2, 3, 4, 5, 6}
Now consider the act of multiplying by some fixed element k of S (modulo 7).
This is essentially a function that maps S to S. Now Fact 1.5.4 says that this
function has an inverse (namely, the modular inverse of k). So it’s a invertible
function, and therefore injective. What’s more, since we’re dealing with finite
sets, f must be a bijection. That is to say, the sets S and aS = {as|s ∈ S} are
the same set.
Now comes the clever part; since these two are the same set, the product of
their elements much be the same. That is to say, 1 · · · 2 · · · 3 · · · 6 is the same
modulo 7 as (k · 1)(k · 2) · · · (k · 6). In other words,
Fact 1.6.1. (Fermat’s Little Theorem) For any a not divisible by a prime p,
we have ap−1 ≡ 1 (mod p).
Fact 1.6.2. (Fermat’s Little Theorem, again) For any a ∈ Z and prime p,
ap ≡ p (mod p).
In fact, we can do the same thing with non-primes in place of p, say n. It’s
just that we need to be careful to take as S the set of all residues that are
relatively prime to n. If we reiterate our steps back there, we will again end up
with k m ≡ 1 (mod n), where m is the number of elements in the set S. But this
number has a name; it’s also ϕ(n) (known as Euler’s totient function), which
leads us to:
We will look more into the powers that become unity in the later chapters.
1.7. A FACT ABOUT FACTORIALS 7
2.1 Introduction
We promised we’d look into which powers are 1 modulo some number; in fact,
we will dive into how powers work modulo some number. So without further
ado, let’s get into that.
9
10 CHAPTER 2. BELIEF IN HIGHER POWERS
Fact 2.2.3. There is a primitive root modulo n if and only if it is of the form
2, 4, pk , 2pk or prime p.
We will not attempt to prove this here. It is very unlikely that in your
olympiad career, you will ever encounter a problem whose solution requires this
result; but it’s a neat fact to know.
νp (an − 1) = νp (a − 1) + νp (n).
νp (an − bn ) = νp (a − b) + νp (n).
2.4 Problems
Problem 2.4.1 For positive integers a > 1 and n, prove that n|ϕ(an − 1).
Crossing fields
3.1 Introduction
Consider normal numbers modulo something gives us a whole new number sys-
tem to work in. For example, the set of residues modulo a prime forms a
so-called field, which means you can not only add, subtract, multiply numbers,
but you can even divide things by non-zero numbers. When you have a brand-
new number system at your disposal, it’s natural to ask how one would solve
equations in such a system. In this chapter, we focus in particular on linear
equations, and systems of them.1
rb ra
x = x0 − , y = y0 +
gcd(a, b) gcd(a, b)
13
14 CHAPTER 3. CROSSING FIELDS
3.5 Pellbound
Until now, we have only looked for solution of diophantine3 equation which are
linear, for example ax + by = c and so on. How about we push it up a notch and
look at quadratics? The simplest examples of this sort would be trivial ones
such as x2 = dy 2 , or maybe x2 − y 2 = c4 . So we look at the next best thing:
equations that look like x2 − dy 2 = c. There are two reasons for this choice:
first, this is the simplest case that doesn’t fall apart by the most trivial lines of
reasoning, and second, pretty much all quadratic diophantine equations in two
variables can be reduced to this form by some change of variable and/or mod
arguments.
Definition 3.5.1. The diophantine equation x2 − dy 2 = 1 for a non-square
integer d is known as a Pell’s equation. The equation x2 − dy 2 = a, for non-
square d and integer a is known as a Pell-type equation.
If d was a square, we could’ve simply factored the left hand side and get
done with it. But it’s not, but being adamant jerks, we still try to factor this
anyway. and end up with the following abomination:
√ √
(x + y d)(x − y d) = 1.
N (z) = a2 − db2 .
√
So the problem becomes to find all z ∈ Z d so that its norm is 1.5 This is
vastly aided by the following result:
√
Fact 3.5.1. Norm is multiplicative; i.e., for any z1 , z2 ∈ Z[ d], we have
N (z1 z2 ) = N (z1 )N (z2 ).
This in particular means that we can multiply two solutions two get a new
one. In particular, if z is a solution, then so is z k for any k ∈ N. If can
somehow get one solution, we can cook up a whole family of solutions. In fact,
the following result says more: all solutions can be generated in this way if you
start with the right “seed”:
3 This means equations where we are only concerned about the integer solutions.
4 Note that the LHS factors.
5 The intuition behind defining N comes from our experience with complex numbers; there
Fact 3.5.2. If z0 > 1 is the smallest positive solution of N (z0 ) = 1, then all
solutions are given by z = ±z0k for non-negative k.
Thus we can find all solutions subject to the existence of one small solution.
But does that always exist? the following fact says yes:
We will not√ go through the proof here. The basic idea is to generate lots of
numbers in Z[ d] that have the same norm, and then find a way to “divide” one
by the other to get one with norm 1. Interested readers are advised to look it up.
3.6 Problems
Problem 3.6.1 Prove that for any integer n, there exist n consecutive integers
so that none of them is a prime power.
Problem 3.6.2 Is there a sequence a1 , ..., a2016 of positive integers, such that
every sum
ar + ar+1 + ... + as−1 + as
(with 1 ≤ r ≤ s ≤ 2016) is a composite number, but gcd(ai , ai+1 ) = 1 for all
i = 1, 2, ..., 2015 and gcd(ai , ai+2 ) = 1 for all i = 1, 2, ..., 2014?
Problem 3.6.3 For a finite non empty set of primes P , let m(P ) denote the
largest possible number of consecutive positive integers, each of which is divisible
by at least one member of P . Show that |P | ≤ m(P ), with equality if and only
if min(P ) > |P |.
1. f (m) and f (n) are relatively prime whenever m and n are relatively prime.
Prove that for any natural number n and any prime p, if p divides f (n) then p
divides n.
Problem 3.6.5 Let S be a set of integers (not necessarily positive) such that
Problem 3.6.8 Show that there are infinitely many positive integer numbers
n such that n2 + 1 has two positive divisors whose difference is n.
s
Y
Problem 3.6.9 Given a positive integer n = pα
i , we write Ω(n) for the
i
i=1
s
X
total number αi of prime factors of n, counted with multiplicity. Let λ(n) =
i=1
(−1)Ω(n) (so, for example, λ(12) = λ(22 · 31 ) = (−1)2+1 = −1). Prove the
following two claims:
1. There are infinitely many positive integers n such that λ(n) = λ(n + 1) =
+1;
2. There are infinitely many positive integers n such that λ(n) = λ(n + 1) =
−1.
18 CHAPTER 3. CROSSING FIELDS
Chapter 4
4.1 Introduction
In this section we will look at some results that have to do with polynomials;
more specifically, integer polynomials.
19
20 CHAPTER 4. TITLE
Fact 4.3.1. For any integer polynomials f and integers a, b, a − b|f (a) − f (b).
Fact 4.3.2. For any integer polynomial f and integer n, f (n)|f (n + f (n)).
This simple fact coupled with other general properties about polynomials
(such that n degree polynomial has n complex roots, polynomials with bigger
degree “grow faster” etc.) often trivializes problems related to integer polyno-
mials.
4.4 Interpollar
One way of obtaining information about polynomials is plugging in random
values into them and see what happens. But how much information can we
obtain in this way? Put in more precise words, how many points do we have
evaluate a polynomial so that we can completely determine it? The following
result provides an easy answer:
You will see how something this hideous can be tamed and made useful in
the exercise problems.
Fact 4.5.1. (Schur) Let f be a non-constant integer polynomial. Then the set
of primes that divide some non-zero integer of the form f (n) (n ∈ Z) is infinite.
If you took my advice in the first chapter and looked up Euclid’s proof of
infinitude of primes, this one shouldn’t be too hard to show; first prove it for
the case when the constant term is 1, then figure out how to extend that to the
general case.
4.6. PROBLEMS 21
4.6 Problems
Problem 4.6.1 Let a, b, c, d, e, f be positive integers and let S = a+b+c+d+
e+f . Suppose that the number S divides abc+def and ab+bc+ca−de−ef −df .
Prove that S is composite.
Problem 4.6.2 Let P (x) be a polynomial of degree n > 1 with integer co-
efficients and let k be a positive integer. Consider the polynomial Q(x) =
P (P (. . . P (P (x)) . . .)), where P occurs k times. Prove that there are at most n
integers t such that Q(t) = t.
Problem 4.6.3 Find all polynomials f (x) with integer coefficients such that
f (n) and f (2n ) are co-prime for all natural numbers n.
Problem 4.6.4 For a fixed integer k, determine all polynomials f (x) with
integer coefficients such that f (n) divides (n!)k for every positive integer n.
Problem 4.6.5 Petya and Vasya play the following game. Petya conceives a
polynomial P (x) having integer coefficients. On each move, Vasya pays him a
ruble, and calls an integer a of his choice, which has not yet been called by him.
Petya has to reply with the number of distinct integer solutions of the equation
P (x) = a. The game continues until Petya is forced to repeat an answer. What
minimal amount of rubles must Vasya pay in order to win?
Problem 4.6.6 Determine all polynomials f with integer coefficients such that
there exists an infinite sequence a1 , a2 , a3 , . . . of positive integers with the prop-
erty: for all n ∈ N, the sum of any f (n) consecutive terms of this sequence is
divisible by n + 1. (Note: This requires f (n) > 0 for all n ∈ N.)
22 CHAPTER 4. TITLE
Chapter 5
Bonus problems
And we end this note with a collection of interesting problems. The difficulty
ranges from easy to really challenging, and are not in any particular order; so
pick any one you find interesting and start working on it!
x2 +y
Problem 5.0.1 Determine the positive integers expressible in the form xy+1 ,
for at least 2 pairs (x, y) of positive integers
Problem 5.0.2 For a natural number k > 1, define Sk to be the set of all
triplets (n, a, b) of natural numbers, with n odd and gcd(a, b) = 1, such that
a + b = k and n divides an + bn . Find all values of k for which Sk is finite.
Problem 5.0.3 Let a and k be positive integers. Prove that for every positive
integer d there exists a positive integer n such that d divides kan + n.
Problem 5.0.4 Prove that there exists a positive integer x such that each of
the elements of the set S has at least 22016 natural divisors where the set S is
defined as:
S = {xi + i|1 ≤ i ≤ 2015}
Problem 5.0.5 Suppose that P (x) is a polynomial with degree 10 and integer
coefficients. Prove that, there is an infinite arithmetic progression (open to both
side) not contain value of P (k) with k ∈ Z
Problem 5.0.6 An integer n > 2 is called tasty if for every ordered pair of
positive integers (a, b) with a + b = n, at least one of ab and ab is a terminating
decimal. Do there exist infinitely many tasty integers?
Problem 5.0.7 Let A1 , A2 , ..., Ak be the subsets of {1, 2, 3, ..., n} such that for
all 1 ≤ i, j ≤ k:Ai ∩ Aj 6= ∅. Prove that there are n distinct positive integers
x1 , x2 , ..., xn such that for each 1 ≤ j ≤ k:
lcmi∈Aj {xi } > lcmi∈A
/ j {xi }
Problem 5.0.8 Find all integer polynomials f (x) such that for all integers a
and all prime numbers p, whenever p | f (a) then also p | a.
23
24 CHAPTER 5. BONUS PROBLEMS
Problem 5.0.9 Big Bird has a polynomial P with integer coefficients such that
n divides P (2n ) for every positive integer n. Prove that Big Bird’s polynomial
must be the zero polynomial.
Problem 5.0.10 Let π(n) denote the largest prime divisor of n for any positive
integer n > 1. Let q be an odd prime. Show that there exists a positive integer
k such that k k k
π q2 − 1 < π q2 < π q2 + 1 .