Você está na página 1de 28

Number Theory in Mathematical

Olympiads
IMOTC 2019

Sutanay Bhattacharya
2
Introduction

0.1 What is this


In this book, I plan to cover all the necessary prerequisites for olympiad number
theory that you all are expected to learn (or, at least, try to learn) before coming
to IMOTC. We will discuss various useful number theory facts, tricks and also
have a few problems for you to try.

0.2 Prerequisites
I plan to start from ground zero, so I’ll assume basic knowledge of:

1. Basic set notations.

2. How to read and write proofs.

3. How to read and write English.

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?

0.3 How to use this


In this document, I’ve included a whole bunch of number-theoretic results, often
with a sketch of their prove. You should try proving them (or completing the
already provided sketch) on your own, or look them up. The topics range
from basic and must-learn things such as modular arithmetic to arcane tools
such as Schur’s theorem. Try to at least give all of them a read, even if they
are hard to digest on first reading. Also, I’ve included several problems with
varying difficulty. Of course, problem solving strategies is not the focus of this
document; so even if you know the necessary facts, applying them to problems
can be hard. Nevertheless, you are advised to try as many of them as you feel
like.

i
ii

0.4 External Resources


This document is by no means comprehensive. For further study, feel free to
check out Number Theory by Naoki Sato and Olympiad Number Theory Through
Challenging Problems by Justin Stevens. If you are looking for standard text-
books on number theory, try An introduction to the theory of numbers by Niven,
Zuckerman and Montgomery.

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 Divided we stand


In number theory, we are often concerned about when some number divides
another. Since deep, philosophical questions “does 17 divide 51?” pop up every
now and then, we have special notation for that.
Definition 1.2.1. If a, b are integers, not both zero, such that there exist k ∈ Z
satisfying a = kb, we say that b divides a, or that a is divisible by b, or that
b | a. If not, we write b 6 |a.
It’s fairly simple to establish some basic properties of this divisibility relation.
Fact 1.2.1. Let a, b, c be integers. Then:
1. a|b =⇒ a|bc;
2. a|b and b|c =⇒ a|c;
3. a|b =⇒ |a| ≤ |b|;
4. a|b and b|a =⇒ a = ±b
5. a|b ⇐⇒ ca|cb provided c 6= 0
6. If a|b1 , a|b2 , · · · , a|bn , then a |x1 b1 + x2 b2 + · · · + xn bn where bi ’s and xi ’s
are all integers.
We will use these results very often, often shoving them under the rug, so
make sure they make sense.

1
2 CHAPTER 1. THE GROUNDWORK

1.3 Euclid’s big idea


Number theorists are morbidly obsessed with when one number divides another.
So even it doesn’t, they try to figure out what happens when you do attempt
to divide. For example, one of the very deep, philosophical questions one might
ask, is “What if I try to divide 56 by 17? Will the fabric of reality fall apart?
Will the space-time continuum collapse? Will there be floating point errors? Or
grimmer still, will there be a remainder?”
Well, from grade school (and also Murphy’s Law) you know the correct
answer is the worst possible one: it will leave a remainder. Moreover, the
quotient and remainder you get in the process is unique: that means it only
depends on the numbers 17 and 56, not on what you had for breakfast that day,
or on the angle the earth’s orbital plane currently makes with moon’s. A rather
simple idea. So simple, that in fact, Euclid beat you to it by more than 2000
years:
Fact 1.3.1. (Euclid’ division algorithm) Let a, b ∈ Z, b > 0, then there exist
unique integers q, r such that a = bq + r and 0 ≤ r < b.
To prove this, simply consider that set {a − bk | k ∈ Z} and look at its small-
est positive element; this should give you r. The rest of the details and the proof
of uniqueness is straightforward and the author has no intention of writing it out.

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.

Definition 1.4.1. A number p > 1 is called a prime number if it has no positive


divisors except 1 and p.

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 .

Thus we have a way to express every number in terms of primes, so to


investigate various properties of integers, it suffices to investigate properties of
primes. However, there are still way too many primes, so that’s not really as
easy as it sounds. In fact, there are infinitely many primes3 . There are many
beautiful proofs of this result, including one involving point-set topology, and
one using the irrationality of π. I strongly suggest you look up some of those,
especially Euclid’s classic proof (if you haven’t seen that yet).

1.5 Mod Psycho 100


Let’s take a nonzero integer n. If we divide numbers by n is good old Euclid
style, we can get any thing from 0 to n−1 as remainder r. Now we can divide (no
pun intended) the set of integers into classes depending on the corresponding
value of r, and it turns members of the same class “behave indistinguishably”
from each other if we are concerned only about remainder left after dividing by
n, in a very precise sense. We will use the remainder (no pun intended, again) of
this chapter to develop the so-called modular arithmetic, whose central theme
is this very idea.
Definition 1.5.1. Let n be a nonzero integer. Then for a, b ∈ Z, we say a and
b are congruent modulo n if n|a − b. This is denoted as a ≡ b (mod n).
Try proving that for positive n, this is same as saying a and b leave the same
remainder when divided by n. Using this (or otherwise), you can show that
congruence is a so-called “equivalence relation”: that is to say, it satisfies the
following properties.
Fact 1.5.1. For a, b, c, n ∈ Z with n 6= 0:
3 This also means there’s no such thing as the largest prime. It’s a shame really; if there

was, we could have called it the Optimus Prime.


1.6. WITH GREAT POWER, COMES UNITY 5

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?

As I mentioned in the beginning, adding and multiplying numbers has the


same effect as adding or multiplying numbers congruent to them if all we are
concerned about is the final value modulo n. In more exact terms,
Fact 1.5.2. If a ≡ a0 (mod n) and b ≡ b0 (mod n), then a+a0 ≡ b+b0 (mod n)
and aa0 ≡ bb0 (mod n).
Using these, we can prove a very useful fact:
Fact 1.5.3. If f is any polynomial with integer coefficients, then

x≡y (mod n) =⇒ f (x) ≡ f (y) (mod n).

We will return to this later on.


From what we have seen so far, you can add, subtract and multiply things
modulo n without much problem. Would be nice if you could divide as well,
right? For division, it’s enough to be able to take reciprocals; in other words,
for any x ∈ Z, it’s enough to figure out y such that xy ≡ 1 (mod n). Of course,
if x has a common factor d with n, then d will divide xy for any y, and that
can’t be 1 (mod n). The remaining case is when gcd(x, n) = 1. In this case,
suppose we need to find xy ≡ 1 (mod n), which is same as ensuring xy − 1 = nk
for some k, which can be written as xy − nk = 1. Does this look familiar? Yes!
This is basically the same as what you’d get if you’d used Bézout on x and n
(do you see why?), so now we have the following:
Fact 1.5.4. For any x relatively prime to n, there is an integer y such that
xy ≡ 1 (mod n). This y is unique4 modulo n, and is called the (modular)
inverse of x (mod n).

1.6 With great power, comes unity


We will start with a warm-up: let a be relatively prime to n. Prove that there
is some nontrivial power of a that is 1 (mod n).

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,

(1 · 2 · · · 6) ≡ (1 · 2 · · · 6)k 6 (mod 7) =⇒ k 6 ≡ 1 (mod 6).

Of course, there’s nothing special about the prime 7 is particular; so we arrive


at:

Fact 1.6.1. (Fermat’s Little Theorem) For any a not divisible by a prime p,
we have ap−1 ≡ 1 (mod p).

This can restated in a more concise way:

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:

Fact 1.6.3. (Euler’s generalization of Fermat’s theorem) If a is a number rela-


tively prime to n, then aϕ(n) ≡ 1 (mod n).

We will look more into the powers that become unity in the later chapters.
1.7. A FACT ABOUT FACTORIALS 7

1.7 A fact about factorials


We saw how multiplying a bunch of things in the residue system of p can lead
to interesting results. A certain Wilson decided to multiply5 them in a different
and got another cool congruence, which we will see now.
Let’s consider the set of residues modulo 7 again: S = {1, 2, 3, 4, 5, 6}. What
other way can you find of computing the product of elements in this set? Es-
sentially, we want some easy way to compute (p − 1)!. It has an even number
of elements. because well, 7 is odd, like most other primes. Let’s try to form
pairs of elements. One way would be pair a number with it’s modular inverse;
so 2 would be paired with 4 because 2 · 4 ≡ 1 (mod 7). But there is a slight
problem; what some number is its own inverse? That can only happen if x2 ≡ 1
(mod 7) ⇐⇒ 7|x2 − 1 ⇐⇒ 7|x − 1 or 7|x + 1, so x can only be 1 or 6. The
products of the rest of pairs are all 1, so the complete product 6! is 1 · 6 ≡ −1
(mod 7).
In general we can show
Fact 1.7.1. (Wilson’s theorem) For any prime p, (p − 1)! ≡= −1 (mod p).
With these out of the way, we’ll move on to slightly more arcane things in
the following chapters. For example, in the next chapter, we’ll investigate which
powers of a given number are 1 modulo n.

5I don’t know how historically accurate this is.


8 CHAPTER 1. THE GROUNDWORK
Chapter 2

Belief in higher powers

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.

2.2 Orders of magnitude


Let a be a number relatively prime to n. We saw in the last chapter, that there
exist a power of a that is 1 modulo n, namely aϕ(n) . Is there any smaller power
that also work? Usually, there is, and it’s so useful that people decided to give
it a name:
Definition 2.2.1. (Order) Let a be relatively prime to n. Then the smallest
positive number x such that ax ≡ 1 (mod n) is called the order of a modulo n,
denoted by ordn (a).
The order also has a special property; it “generates” all the other powers
that return 1.
Fact 2.2.1. Let k be an integer so that ak ≡ 1 (mod n). Then k is a multiple
of ordn (a).
The proof is not too hard; here’s hint: Euclidean division. In particular, this
implies ordn (a)|ϕ(n), and for p prime, ordp (a)|p − 1. Thus the order of a can be
at most ϕ(n), and will always be a divisor of that. In case it is exactly ϕ(n), a
is called a primitive root modulo n. You can easily check the following result:
Fact 2.2.2. If a is a primitive root modulo n, then the numbers 1, a, a2 , · · · , aϕ(n)−1
are all the distinct residues (relatively prime to n) modulo n.
But does such a primitive root always exist? This is not an easy question to
settle, but the following result is known:

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.

2.3 The aLTErnative facts


In the last section, we fixed n and tried to find numbers of the form ak − 1 that
have n as a factor. Here, we go the other way: we look at factors of numbers of
the form ak − 1.
One obvious factor is a − 1. So is any number of the form ad − 1, d being
any divisor of k. In fact, one can prove1 the following:
Fact 2.3.1. For positive integers a, m, n, gcd (am − 1, an − 1) = agcd(m,n) − 1.
Factors of the form a − 1 are of special interest; in particular, prime factors
of a − 1 are something worth looking at. Say p|a − 1. Then p obviously divides
an − 1; but does p2 ? What about higher powers of p? The next fact answers
that question, but first we’ll define a new notation:
Definition 2.3.1. For a positive n and prime p, νp (n) denotes the largest non-
negative integer k such that pk |n. In other words, it’s the exponent of p in the
prime factorization of n.
Now we’re ready to state the so called lifting the exponent lemma:
Fact 2.3.2. Let p be an odd prime factor of a − 1. Then

νp (an − 1) = νp (a − 1) + νp (n).

In fact we can say more:


Fact 2.3.3. Let p be an odd prime such that p 6 |a, p 6 |b, and p|a − b. Then

νp (an − bn ) = νp (a − b) + νp (n).

This can be proven without difficulty by induction of νp (n). We can state


an analogous version for an + bn :
Fact 2.3.4. Let p be an odd prime such that p 6 |a, p 6 |b, and p|a + b. Then for
odd n,
νp (an + bn ) = νp (a + b) + νp (n).
Notice that in the statement of all these forms of the lemma, we took p as
an odd prime. We can have something very similar for p = 2, but the situation
is slightly complicated there:
1 If you get stuck, here’s a hint; can you prove gcd (am − 1, an − 1) =
gcd am−n − 1, an − 1 ? What next?

2.4. PROBLEMS 11

Fact 2.3.5. If x, y are both odd, then


• If 4|x − y, then ν2 (xn − y n ) = ν2 (x − y) + ν2 (n).
• If n is even, then ν2 (xn − y n ) = ν2 (x − y) + ν2 (x + y)ν2 (n) − 1.
The proofs of all of these are very similar, and are left as an exercise.

2.4 Problems
Problem 2.4.1 For positive integers a > 1 and n, prove that n|ϕ(an − 1).

Problem 2.4.2 Let n > 1 be an integer. Show that n 6 |2n − 1.


Problem 2.4.3 Find all pairs of primes p, q satisfying pq|(5q − 2q )(5p − 2p ).
Problem 2.4.4 Find all pairs of primees p, q such that pq|5p + 5q .
Problem 2.4.5 Show that 2 is a primitive root modulo 3n for n ≥ 1.

Problem 2.4.6 Find all positive integers n such that n2 |2n + 1.


Problem 2.4.7 Let a ≥ 3. Prove that there is an integer n having exactly
2019 prime factors that satisfies n|an − 1.
12 CHAPTER 2. BELIEF IN HIGHER POWERS
Chapter 3

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

3.2 The one true equation


Let’s say we want to solve an equation of the form ax ≡ k (mod b). This is
obviously equivalent to solving ax + by = c for integers x, y. Can these always
be solved? Well, one obvious condition is gcd(a, b) has to divide c. Turns out
that’s enough. You can try to prove the following:

Fact 3.2.1. The equation ax + by = c has integer solutions in x, y if and only


if gcd(a, b)|c. If x0 , y0 is one solution pair then all solutions are given by

rb ra
x = x0 − , y = y0 +
gcd(a, b) gcd(a, b)

where r can be any integer.

In particular, in case n happens to be a prime p, then solving ax ≡ c (mod p)


is child’s play using inverses (why?).
1 ...which means, we see how “lines” cross in these fields. Haha, geddit? Uh, yeah, I’m

sorry for real this time.

13
14 CHAPTER 3. CROSSING FIELDS

3.3 ...and lots of them


Now that we have mastered single linear equations, it’s about time we moved
on to systems of them. Let’s suppose you have a whole bunch of equation you
need to satisfy simultaneously, something like
x ≡ a1 (mod n1 )
x ≡ a2 (mod n2 )
..
.
x ≡ ak (mod nk )
The following theorem gives some idea about when a solution might exist:
Fact 3.3.1. (Chinese remainder theorem) In the above system, if n1 , · · · , nk
are pairwise relatively prime, then there is a solution that is unique modulo
lcm(n1 , · · · , nk ).
This simple fact turns out to be immensely useful in a bunch of scenarios2 :
1. When you want to construct x that satisfies properties like x ≡ ai (mod ni ).
2. When you want bounds on the possible values of x (since after the smallest
solution, the next one would bigger than lcm(n1 , · · · , nk ), which is usually
pretty large).
3. When you want to construct x modulo something big, but it’s easier to
construct it modulo prime powers.

3.4 The Math of McNuggets


In section 1, when we looked at expressions like ax + by, we considered all
possible integers in place of x and y, including negatives. But what if we didn’t?
In particular, for some positive integers a, b, say we wanted to investigate all
numbers that can expressed in the form ax+by for nonnegative x and y. In fact,
this problem can be phrased in a very natural setting: suppose in a country,
there are only coins with denominations a and b. What is the largest amount
that cannot be paid by these coins? The following result answers this question:
Fact 3.4.1. (Chicken McNugget Theorem) For any two relatively prime positive
integers m, n, the greatest integer that cannot be written in the form am + bn
for nonnegative integers a, b is mn − m − n. In fact, there are exactly (m−1)(n−1)
2
positive integers which cannot be expressed in the form am + bn.
To prove this, one may use the results of section 3.1 to find all integer solution
and analyse when they are non-negative. To show the second part, try to show
that in each pair of the form (k, (m − 1)(n − 1) − k + 1), exactly one element is
expressible.
2 Look at Evan Chen’s handout on CRT for more.
3.5. PELLBOUND 15

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.

Since we have transitioned from normal integers to weird demi-integers involving


radicals,
√ we need
√ to consider those as well. In particular, let us look at the set
Z[ d] = {a + b d|a, b ∈ Z}. The key observation is that this set is similar to
integers in many ways: you can add, multiply stuff as you please and still within
the set. Now in order to phrase the problem in a slightly more concise, we say
the following:
√ √
Definition 3.5.2. The norm of the number z = a + b d ∈ Z[ d] is defined as

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

N (z) = zz has many useful properties


√ and gives a way to measure the
√ complex number in
terms of real. Here z = a + b d has a “conjugate”, namely z = a − b d, so it is reasonable
to try and work with zz.
16 CHAPTER 3. CROSSING FIELDS

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:

Fact 3.5.3. A Pell’s equation always has integer solutions.

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.

Now this leaves us with the Pell-type equations: x2 − dy 2 = a, which is


same as saying N (z) = a. Again, as before, if z0 is a solution of N (z0 ) = a,
and z1 satisfies N (z1 ) = 1, then z0 z1k gives an infinite family of solutions, and if
you choose z0 , z1 minimal, these are all of them. But unlike in the previous, a
solution may not exist. There are ways to find out when they do and find them
in that case; we will not go through them here.

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 |.

Problem 3.6.4 Let N be the set of positive integers. Let f : N → N be a


function satisfying the following two conditions:

1. f (m) and f (n) are relatively prime whenever m and n are relatively prime.

2. n ≤ f (n) ≤ n + 2012 for all n.

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

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


3.6. PROBLEMS 17

2. 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.
Problem 3.6.6 Let a, b and c be positive integers, no two of which have a
common divisor greater than 1. Show that 2abc − ab − bc − ca is the largest
integer which cannot be expressed in the form xbc + yca + zab, where x, y, z are
non-negative integers.

Problem 3.6.7 Prove that if m = 2 + 2 28n2 + 1 is an integer for some n ∈ N,
then m is a perfect square.

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

Fantastic polynomials and


how to interpolate them

4.1 Introduction
In this section we will look at some results that have to do with polynomials;
more specifically, integer polynomials.

4.2 One ring to rule them all


The algebraic structure the the set of integer polynomial possesses (a so-called
“ring”) has many similarities with the set of integers, such as:
1. You can perform Euclidean algorithm on monic1 polynomials.
2. This means we can prove something analogous to Bézout for polynomials.
3. Even better, there is some sort of prime factorization in polynomials.
These ideas are summarized in the following facts:
Fact 4.2.1. Let P, Q be two integer polynomials, Q monic. Then there exist
unique integer polynomials X, R such that
P = QX + R
and deg R < deg Q or R = 0.
Fact 4.2.2. If P, Q are relatively prime integer polynomials, then there are
integer polynomials A, B such that AP + BQ = N for some integer N .
Fact 4.2.3. Any monic polynomial can be factored into monic irreducible poly-
nomials uniquely (upto reordering of factors).
0 Title credits: Pulkit Sinha.
1 Which means, its leading coefficient is 1.

19
20 CHAPTER 4. TITLE

4.3 A divisibility result


We saw in Fact 1.5.3. that x ≡ y (mod n) implies f (x) ≡ f (y) (mod n) for
integer polynomial f . Since x ≡ y (mod x − y), this also means

Fact 4.3.1. For any integer polynomials f and integers a, b, a − b|f (a) − f (b).

This also means n + f (n) − n|f (n + f (n)) − f (n), which leads to

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:

Fact 4.4.1. (Lagrange interpolation formula) If p is a polynomial with degree


n or less, then and x0 1, · · · xn are distinct reals, then
n
X Y x − xj
p(x) = p(xi ) .
i=0
xi − xj
0≤j≤n
i6=j

You will see how something this hideous can be tamed and made useful in
the exercise problems.

4.5 Schur’s Theorem


Remember how we saw there’s an infinite number of primes? Turns the some-
thing similar is true for range sets of most polynomials as well.

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 .

Problem 5.0.11 If a polynomial P (x) ∈ Z[x] is a the square of a positive


integer for all positive integers x, then prove that there exists a polynomial
Q(x) ∈ Z[x] such that P (x) = [Q(x)]2 .

Problem 5.0.12 An ordered pair (x, y) of integers is a primitive point if the


greatest common divisor of x and y is 1. Given a finite set S of primitive points,
prove that there exist a positive integer n and integers a0 , a1 , . . . , an such that,
for each (x, y) in S, we have:

a0 xn + a1 xn−1 y + a2 xn−2 y 2 + · · · + an−1 xy n−1 + an y n = 1.

Você também pode gostar