LTE Handout
LTE Handout
LTE Handout
Contents
Contents I
0.1 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
0.2 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Legendre’s Formula 28
2.1 The p-adic valuation of n! (factorial-n) . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3 Practice Problems 33
3.1 Introduction and LTE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.2 Zsigmondy’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.3 Legendre’s Formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Acknowledgements 1
0.1 Acknowledgements
This handout is one of the many handouts of Gaussian Curvature. This handout is intended for Intermediate
to Advanced problem solvers in Number Theory; it covers topics like LTE, Zsigmondy’s, Legendre’s Formula
and etcetra. This handout is authored by Mohammed Imran aka Rama1728, Aniruddha Sharma aka
Aniruddha07 and one mysterious alien Aritra12.
Nevertheless also Mr.C, phoenixfire, Aritra12, NJOY and Aryan-23 pointed out numerous errors and refined
the manuscript.
We are also thankful to the several users on AoPS who posted problems and solutions and many resources
which we noted down or also we forgot some to refer to. We hope that this handout is error free. We also
hope that you find this handout helpful.
Remark. No handout is all perfect so there might be typos. If you find any, feel free to mail them
at gaussiancurv180@gmail.com
Definition (Typos)— The errors which are done by human beings accidentally!
Note that not all authors are human beings so there are no faults of non-humans or aliens..
Notation 2
0.2 Notation
Notation Meaning
R The set of reals and R+ will denote positive reals accordingly.
N The set of positive integers.
Z The set of integers
Q The set of rational numbers
a|b a divides b
∈ In
∃ There exists
∀ For All
gcd(a, b) The greatest common divisor of a and b
lcm(a, b) The least common multiple of a and b.
WLOG Without loss of generality
FTSOC For the Sake of Contradiction
Introduction CHAPTER 1. THE YOGA OF P-ADIC VALUATIONS 3
Chapter 1
In this chapter, we aim to do a rather detailed study of the p-adic valuations map v p : N → N, where p is
a fixed prime.
We now introduce a very important definition: If n is a positive integer more than 1, then v p (n) is the
power of p in the prime factorization of n.
After surfing through the basic properties of the map v p , we will use them to derive some important
and intriguing results.
1.1 Introduction
Let p be a fixed prime. It will be more convenient if we extend the map v p : N → N to a map v p : Z → N∪{∞}
by defining v p (n) = v p (|n|) for all n ∈ N/{0, ±1}, v p (±1) = 0 and v p (0) = ∞. In other words, we say that
v p (n) is the largest non-negative integer k such that pk |n. In particular, if v p (n) ≥ 1, then p|n.
˜ For integers a, b and prime p with v p (a) > v p (b), we have v p (a + b) = v p (b)
Presented below is a theorem which contains some of the elementary properties of p-adic valuations.
Introduction 4
Theorem 1.1.1 (Basic Properties) — a) If n is a non-zero integer, then we can write n = pv p (n) ·
m, where m is an integer with gcd(m, p) = 1.
Proof. a) Note that if p|n, and v p (n) = k, then clearly from the definition of the map v p , we have
pv p (n) = pk |n. So, n = pv p (n) · m for some integer m. Note that m cannot be divisible by p, as if
it was, then pk+1 |n, implying that v p (n) ≥ k + 1 contradicting the fact that v p (n) = k. So, we
must have 1 = gcd(m, p) = gcd m, pk = gcd m, pv p (n) and we are done.
˜
b) Let n = P1a1 · P2a2 · · · Pkak . Then, note that vPi (n) = ai for i = 1, 2, 3, · · · k. Thus,
k k
vPi (n)
n = ∏ Piai = ∏ Pi = ∏ pv p (n)
i=1 i=1 p|n
c) Note that this is obvious when one of a or b is 0, so suppose ab 6= 0. By a), we can write
a = pv p (a) · u and b = pv p (b) · v, where gcd(u, p) = gcd(v, p) = 1. Then, gcd(uv, p) = 1 and ab =
pv p (u)+v p (v) · (uv). Hence v p (a) + v p (b) = v p (ab). Next, pmin(v p (a),v p (b)) divides both a and b, and
hence it divides a + b. Therefore, v p (a + b) ≥ min (v p (a), v p (b)), with equality if and only if
v p (a) 6= v p (b). ˜
The following theorem although quite elementary is the root to tackling various complex problems.
Theorem 1.1.2 — If a, b are integers then a|b if and only if v p (a) ≤ v p (b) for all primes p.
Proof. Without loss of generality, let a and b be non-zero. Then, if a|b, and b = ac, we have
v p (b) = v p (a) + v p (c) ≥ v p (a) for every prime p. Now, assume that v p (b) ≥ v p (a) for all primes p.
Then according to Theorem 1.1.1 b), we have
a = ∏ pv p (a) and b = ∏ bv p (b)
p p
where the product ranges for all primes p. Since v p (a) ≤ v p (b) for all primes p, the powers of the
primes in the prime factorisation of b is greater than or equal to that of a. Therefore, we have a|b,
and we may conclude.
Introduction 5
Consequently, one may wonder whether or not there exists a connection between powers of integers and
their p-adic valuations. The answer is yes. We present a theorem explaining the connection.
Theorem 1.1.3 — Let a and n be positive integers. Then a is a nth power of an integer if and only
if v p (a) ≡ 0(mod n).
If a and b are relatively prime numbers such that ab is a perfect nth power, then so are a and b.
v p (gcd(a, b)) = min (v p (a), v p (b)) and v p (lcm(a, b)) = max (v p (a), v p (b))
Proof. If one of a or b is 0, then this is trivial. Thus, we may assume that ab 6= 0. Now let a = pa1 ·
a2 andb = pb1 · b2 , where a1 and b1 are nonnegative integers. Then, gcd(a, b) = pmin(a1 ,b1 ) · gcd(a2 , b2 ),
where v p (a2 ) = v p (b2 ) = 0. Thus, if we assume a1 ≤ b1 , then we have
v p (gcd(a, b)) = v p (pa1 ) + v p (gcd(a2 , b2 )) = a1 = min(v p (a), v p (b))
where the second-last equality follows from the fact that v p (gcd(a2 , b2 ) = 0(since a2 and b2 are not
Introduction 6
divisible by p, their gcd is not divisible by p, and hence v p (gcd(a2 , b2 ) = 0). We may now conclude.
The proof of the second part of the problem is left as an exercise for the reader.
and
v p (lcm(x1 , x2 , · · · xn )) = max v p (xi )
1≤i≤n
We shall now move on and tackle some concrete and challenging problems.
Problem 1.1.1. Show that a rational number q is an integer if and only if v p (q) ≥ 0 for every prime
p.
Solution. Let q = ab . Then, v p (q) = v p (a) − v p (b). Thus, it suffices to show that b | a if and only if
v p (a) ≥ v p (b), but this is exactly what we showed in Theorem 1.1.2!
Note. Though we defined ν p for the integers, we can also slightly modify it and define it for rationals,
and that is possible due to property 2.
Solution. Let for all primes p, v p (a) = x p , v p (b) = y p and v p (c) = z p . Then, taking the p-adic
valuations on both sides of the equality we have to prove, it suffices to show that
lcm(a, b, c)2 gcd(a, b, c)2
vp = vp
lcm(a, b) · lcm(b, c) · lcm(c, a) gcd(a, b) · gcd(b, c) · gcd(c, a)
for all primes p. This is equivalent to each of the following:
v p lcm(a, b, c)2 − v p ∏ lcm(a, b) = v p gcd(a, b, c)2 − v p ∏ gcd(a, b)
cyc cyc
Introduction 7
Now, since this equation is symmetric, we can assume that x p ≤ y p ≤ z p . Then,it suffices to prove
that
2x p − x p − y p − x p = 2z p − z p − y p − z p
which is clear. This completes the proof.
Remark. This problem can also be solved using the fact that
xy
lcm(x, y) =
gcd(x, y)
The rest of the proof is left for the reader as an easy exercise.
where m = lcm(b1 , b2 , · · · , bk )
Solution. Fix a prime p and let xi = v p (ai ) and yi = v p (bi ). By hypothesis, we have min(xi , yi ) = 0
for all i and we need to prove that if
z = max(y1 , y2 , · · · , yk ),
then
min(x1 − y1 + z, x2 − y2 + z, · · · , xk − yk + z) = min(x1 , x2 , · · · , xk )
Note that xi − yi + z ≥ xi for all i, so the right hand side is at least the left hand side. Now, if z = 0,
then our assumption forces all yi to be 0 and the equality is clear. Otherwise, let y j = z > 0 for some
j, forcing x j = 0, implying x j − y j + z = 0 and we may conclude.
Let k = log p (n) , so that pk ≤ n < pk+1 . Then, for any i ∈ {1, 2, 3, · · · , n} is i divisile by pk+1
and so
max v p (i) = v p (pk ) = k
1≤i≤n
pv p (lcm(1,2,3,··· ,n)) ≤ n
and multiplying for all primes p less than n yields the desired result. This settles the proof.
Problem 1.1.5 (IMO 2007 Shortlist). Let b, n > 1 be integers. Suppose that for each k > 1,
there exists an integer ak such that b − ank is divisible by k. Prove that b = An for some integer A.
Solution. Let the prime factorization of b be b = pα1 1 · pα2 2 · · · pαs s . It suffices to show that all the
exponents αi are divisible by n. Apply the condition for k = b2 . The number b − ank is divisible by b2
and hence, for each 1 ≤ i ≤ s, it is divisible by p2αi αi
i > pi as well. Therefore,
and
ank ≡ b 6≡ 0 (mod pi i+1 )
α
which implies that the largest power of pi dividing ank is pαi i . Since ank is a complete nth power, this
implies that αi is divisible by n as desired.
Solution. The key idea for the problems is to find a prime that divides into the denominator more
than in the numerator. Notice that
n n n!
1
∑ i ∑ n!i
=
i=1 i=1
!
n
n!
We consider v2 ∑ . Then, as
i=1 i
n! n! n! n!
v2 > v2 = v2 + .
2i − 1 2i 2i − 1 2i
n! n! n!
We then get v2 + = v2 and repeating to sum up the factorial in this way we
4i − 2 4i 4i
arrive at !
n
n! n!
v2 ∑ = v2
i=1 i 2blog2 nc
n
1
However for ∑i to be an integer we need
i=1
!
n
n!
v2 ∑i ≥ v2 (n!)
i=1
n!
v2 ≥ v2 (n!)
2blog2 nc
0 ≥ blog2 nc
a contradiction. This completes the proof.
Problem 1.1.7 (Saint Petersburg Olympiad 2006). Let a1 , a2 , ..., a101 be positive integers such
that gcd(a1 , a2 , . . . , a101 ) = 1 and the product of any 51 of these numbers is divisible by the product
of the remaining 50. Prove that a1 a2 . . . a101 is a perfect square.
Solution. The problem readily forces us to check if we can show a1 a2 . . . a101 is a perfect square and
in order to show that a1 a2 . . . a101 is a perfect square, it’s equivalent to showing that given a prime
number p that divides a1 a2 . . . a101 , we have v p (a1 a2 . . . a101 ) = v p (a1 ) + v p (a2 ) + . . . + v p (a101 ) is an
even integer.
From the given fact that gcd(a1 , a2 , . . . , a101 ) = 1, we get min{v p (a1 ), v p (a2 ), . . . , v p (a101 )} = 0.
This means that there must be at least one ai such that v p (ai ) = 0. WLOG, let
Introduction 10
and
v p (a1 ) + v p (a2 ) + . . . + v p (a50 ) + v p (a101 ) ≥ v p (a51 ) + v p (a52 ) + . . . + v p (a100 ).
Now, notice that since v p (a101 ) = 0, we have
and
v p (a1 ) + v p (a2 ) + . . . + v p (a50 ) ≥ v p (a51 ) + v p (a52 ) + . . . + v p (a100 )
which means
v p (a1 ) + v p (a2 ) + . . . + v p (a50 ) = v p (a51 ) + v p (a52 ) + . . . + v p (a100 )
and so
Problem 1.1.8. Find all positive integers a and b for which (a + b2 )(a2 + b) is a power of 2.
Solution. We will prove that a = b = 1 is the unique solution of the problem. Assume that (a, b) 6=
(1, 1) and without loss of generality, that a > 1. Write a + b2 = 2m and b + a2 = 2n for some m, n ≥ 1.
If a is even then so is b and since v2 (a) < m = v2 (2m ), we have v2 (2m − a) = v2 (a), thus
and similarly 2v2 (a) = v2 (b), contradicting our assumption that v2 (a) > 0.
Hence a is odd. If b > 1, then a similar argument as above yields
and
v2 (a + 1) < v2 (a2 − 1) = v2 (2n − (b + 1)) = v2 (b + 1)
a contradiction. Thus the only possible solution is (a, b) = (1, 1).
Problem 1.1.9 (Erdos-Turan). Let a1 < a2 < · · · be an increasing sequence of positive integers.
Prove that for any N we can find i 6= j such that ai + a j has a prime factor greater than N.
Introduction 11
Solution. Fix N and let p1 , p2 , · · · pk be all primes not exceeding N. Suppose that for all i 6= j,
all prime factors of ai + a j are among p1 , p2 , · · · , pk . Fix any positive integer d greater than all the
numbers av − au with 1 ≤ u < v ≤ k + 1. Fix also n > (p1 p2 · · · pk )d and note that for all 1 ≤ i ≤ n we
have
an + ai > (p1 p2 · · · pk )d
, thus there is ji ∈ {1, 2, 3, · · · , k} such that v pi j (an + ai ) > d. Since j1 , j2 , · · · , jk+1 are all between 1
and k, two of them must be equal, say ju = jv with 1 ≤ u < v ≤ k + 1. Let p = p ju , so that
It follows that v p (av − au ) > d contradicting the fact that d is greater than av − au . This completes
the proof.
Problem 1.1.10 (IMO Shortlist 2009). Let f : N → N be a non-constant function such that
a − b divides f (a) − f (b) for all a, b ∈ N. Prove that there exist infinitely many primes p such that
p divides f (c) for some positive integer c.
Solution. Suppose that the conclusion fails and let p1 , p2 , · · · , pk be all primes appearing in the prime
factorization of the numbers f (1), f (2), · · ·. Take any positive integer x and write f (x) = pα1 1 pα2 2 · · · pαk k
for some non-negative integers α1 , α2 · · · αk . Let
Since as divides f (x + as ) − f (x) and since v pi ( f (x)) < v pi (as ), it follows that
f (x + as ) = f (x),
and this holds for all s ≥ 1. But then x + as − 1 divides f (x) − f (1) = f (x + as ) − f (1) for all s ≥ 1, so
f (x) = f (1).
Since x was arbitrary, this means that f is a constant function, contradicting the hypothesis of the
problem. This completes the proof.
Problem 1.1.11 (Tuymaada 2004). Let a, n be positive integers such that a ≥ lcm(1, 2, · · · , n − 1).
Prove that there are pairwise distinct prime numbers p1 , p2 , · · · , pn such that pi | a + i for 1 ≤ i ≤ n.
Introduction 12
We claim that x1 , x2 , · · · , xn are pairwise relatively prime integers and xi > 1 for all i. Note that this
immediately implies the result, by taking pi to be an arbitrary prime divisor of xi . To prove the claim,
note that xi > 1 is clear, since the equality a + i = gcd(a + i, b) would force a + 1 ≤ b. Assume now
that a prime p divides both xi and x j , for some 1 ≤ i < j ≤ n. Let k = v p (b). Then
Problem 1.1.12 (IMO Shortlist 2011). Let d1 , d2 , . . . , d9 be pairwise distinct integers. Prove
that if x is a sufficiently large integer, then (x + d1 ) (x + d2 ) . . . (x + d9 ) has a prime divisor greater
than 20 .
Solution. We will try to prove this by taking the contrary that P(x) has no prime factors greater
than 20and we need to show that x is bounded.
Let D = ∏ (d j − di ). Observe for all x that gcd(x + di , x + d j ) | d j − di | D. In particular, for all
1≤i< j≤9
primes p ≤ 20,
min{v p (x + di ), v p (x + d j )} ≤ v p (D),
so there is at most one j = 1, . . . , 9 with v p (x + d j ) > v p (D).
But there are eight primes p ≤ 20, so by Pigeonhole for some j = 1, . . . , 9, we have v p (x + d j ) ≤ v p (D)
for all p, so x + d j ≤ D, implying that x is bounded above by a constant, which is a contradiction as
x tends to infinity.
Problem 1.1.13 (APMO 2017). Call a rational number r powerful if r can be expressed in the form
pk
for some relatively prime positive integers p, q and some integer k > 1. Let a, b, c be positive
q
rational numbers such that abc = 1. Suppose there exist positive integers x, y, z such that ax + by + cz
is an integer. Prove that a, b, c are all powerful.
Solution. Fix a prime p and look at ν p ’s. Note ν p (a) + ν p (b) + ν p (c) = 0.
Let p be a prime for which ν p (a) > 0. WLOG ν p (c) < 0; then it follows ν p (b) < 0 too.
Introduction 13
y
Then we conclude yν p (b) = zν p (c), so set ν p (b) = −z0 k and ν p (c) = −y0 k where y0 = gcd(y,z) and
z0 = gcd(y,z)
z
.
0 < ν p (a) = −ν p (b) − ν p (c) = k · (y0 + z0 ).
Thus, in conclusion, whenever ν p (a) > 0 we have y0 + z0 divides ν p (a).
Problem 1.1.14 (India 2019 TST). Show that there do not exist natural numbes a1 , a2 , · · · , a2018
such that the numbers
Solution. We love our method of contrary as usual. No sins here to use that as our weapon and
therefore we hold on the contrary that all the given sums are powers of 5. For a prime p and a
natural number n, let v p (n) denote the highest exponent of p dividing n. In what follows, indices are
considered modulo 2018.
Suppose that 5 divides ai for some 1 ≤ i ≤ 2018. Then clearly 5 divides a j for all 1 ≤ j ≤ 2018. Let k
be such that
v5 (ak ) = max{v5 (a1 ), v5 (a2 ). · · · , v5 (a2019 )}.
Then v5 (a2018
k + ak+1 ) = v5 (ak+1 ) and hence
a2018
k + ak+1 ≤ ak+1 ,
a contradiction. This implies that 5 does not divide ai for any i = 1, 2, · · · , 2018.
Now let bi = a2018 i + ai+1 for i = 1, 2, · · · , 2018. Without loss of generality, assume
b1 = min{b1 , b2 , · · · , b2018 }. Let b = b1 . Then since all bi ’s are powers of 5 it follows that bi ≡ 0
2
(mod b) for all i = 1, 2, · · · , 2018. Note that a2 ≡ −a2018 1 (mod b). Therefore a3 ≡ −a20182 ≡ −a2018
1 .
2018k
Proceeding similarly, ak+1 ≡ −a1 for k = 3, 4, · · · , 2018; in particular, it follows that b divides
2018 2018
a1 + a2018
1 . Since (a 1 , b) = (a 1 , 5) = 1, we see that b divides a12018 −1 + 1.
Let d denote the smallest natural number such that ad1 ≡ 1 (mod b). Then d divides ϕ(b) = 4b/5.
2018 −1
Also, since a2018
1 ≡ −1 (mod b) it follows that d is even and that it divides 2(20182018 − 1).
Therefore d divides the quantity gcd(4b/5, 2(20182018 − 1)) = 2, so d = 2 and therefore b = a2018 + a2
divides a1 + 1, implying a1 = a2 = 1 and thus 5|2, which is absurd. This completes the proof.
Problem 1.1.15 (ELMO 2017 Shortlist). For each integer C > 1 decide whether there exist
pairwise distinct positive integers a1 , a2 , a3 , ... such that for every k ≥ 1, akk+1 divides Ck a1 a2 ...ak
Introduction 14
Note. In this solution, we use estimates for Hn (the nth harmonic number). If you do not know about
that, then you can skip this.
Solution. The answer is no. Suppose not for a fixed C. Consider any prime p. Then the problem
gives
kν p (ak+1 ) ≤ kν p (C) + ν p (a1 ) + · · · + ν p (ak ). (1.1)
Now we have the following key claim (guessed by small values)
which serves as the base case since H1 = 1. Now assume the result till some n. Then putting
k = n in Equation 1, we find
and hence
1 1 1 1
ν p (an+1 ) − ν p (a1 ) ≤ n+ +···+ +···+
n 1 1 n−1
1 1 1 1 1 1 1 1
= 1 + + + · · · + + · · · + + +···+ +···+
n |2 {z 2} |n {z n} 1 1 n−1
2 n
1 1 1 1
= n· +n· +···+n· = Hn .
n 1 2 n
The key hypothesis we need now is that ai are pairwise distinct. We want to try to force ν p (ai ) to
be equal for all primes to get a contradiction. The claim gives ν p (C) = 0 =⇒ ν p (an ) ≤ ν p (a1 ). In
particular ν p (am ) is eventually constant. So ignore primes for which ν p (C) = 0. This means we only
have a finite set of prime factors to worry about for the sequence now.
Now we have the following very famous estimate for HN :
Hn ≤ 1 + log(n + 1) =⇒ Hn ≤ log n + log n2 = 3 log n.
Introduction 15
Claim— For any large k, there exists an interval I of length k such that bA log xc is constant over I
and less than k.
Proof. The proof is not as hard as it looks. Firstly, observe that A log x < k ⇐⇒ x < ek/A . Next,
k
A log(x + k) − A log x = A log 1 + .
x
So even if we pick x = ek/A , for large enough k the above expression will be very small. Hence
we can ensure A log(x + k), A log(x) lie between the same two integers.
Problem 1.1.16 (Fake USAMO 2020). Suppose that C is a positive integer and a1 , a2 , a3 , . . . is an
infinite sequence of positive integers satisfying
q
an+1 = a3n −Can
for all positive integers n. Prove that this sequence must be eventually constant, i.e. there exists a
positive integer N such that aN = aN+1 = aN+2 = . . ..
We begin by deriving some restrictions on the primes that divide an , for any n. Suppose
ν (a )
that, for some n, p | an but p - C. Then, ν p (a3n −Can ) = ν p (an ), so ν p (an+1 ) = p 2 n . Repeating this,
ν (a )
we find that ν p (an+k ) = p2k n , which is impossible for sufficiently large k (since ν p (an+k ) must be an
integer). Hence, if p | an , we must have p | C. Additionally, suppose p | an+1 for some n ≥ 1. Since
p | C, we have
p | a3n −Can
p | a3n
p | an .
Repeating this, we must have p | a1 . These two claims together imply that, for all k, we have
rad(ak ) = rad(a1 ) | rad(c) Now, pick p | a1 . Note that
1 1 1
ν p (an+1 ) = ν p (a3n −Can ) ≥ min (3ν p (an ), ν p (C) + ν p (an )) = (ν p (an ) + min (2ν p (an ), ν p (C))) ,
2 2 2
Introduction 16
where equality holds unless ν p (an ) = 21 ν p (C). We will prove that, for some `, ν p (a` ) = ν p (C). Suppose
for some n that ν p (an ) ≤ 21 ν p (C). In this case,
3
ν p (an+1 ) ≥ ν p (an ).
2
Hence, for some j > n, we will have ν p (an ) > 21 ν p (C).
Now, suppose ν p (C) > ν p (an ) > 21 ν p (C). Then, we have
1
ν p (an+1 ) =
(ν p (an ) + ν p (C))
2
=⇒ ν p (C) >ν p (an+1 ) > ν p (an ).
By iterating this, we find that ν p (C) > ν p (an+k ) > ν p (an+k−1 ) > · · · > ν p (an ). As the ν p (ai ) and ν p (C)
are all positive integers, this is impossible for large enough k. Finally, if ν p (an ) > ν p (C) > 21 ν p (C), we
find that
1
ν p (an+1 ) = (ν p (an ) + ν p (C))
2
=⇒ ν p (an ) >ν p (an+1 ) > ν p (C).
By iterating this, we find that ν p (an ) > ν p (an+k ) > ν p (an+k−1 ) > · · · > ν p (C), which is, again, impos-
sible for large k.
The previous two paragraphs imply that, for each n, we either have ν p (an ) ≤ 21 ν p (C) or ν p (an ) = ν p (C).
As we cannot have ν p (an ) ≤ 12 ν p (C) for all n, it follows that we have ν p (an ) = ν p (C) for some n.
However, if ν p (an ) = ν p (C),
1
ν p (an+1 ) = (ν p (an ) + min (2ν p (an ), ν p (C))) = ν p (an ),
2
implying that the sequence {ν p (ai )}∞
i=1 is eventually constant. It follows by repeating this argument
with every prime p | a1 | C (of which there are only finitely many) that the sequence {ai } is eventually
constant, so we are done.
Lifting the Exponent Lemma (LTE) 17
Now that we are familiar with the basic notations of the map v p and also on how to use the function v p
to tackle extremely challenging problems in those specific, we will go one step further as we learn about
the basics of the celebrated ”Lifting the Exponent Lemma”.
The lemma, is elegant yet very flexible and not difficult to prove and the heart of the solutions to many
of the most challenging problems in the diverse field of Olympiad number theory. In this section, however
it has a wide range of application in problems.So as usual practising more and more problem will provide
you some experience ’where to use how’.
This section implicates its importance and will give you a breif information about it!
Theorem 1.2.1 (Lifting the Exponent lemma) — Let p be an odd prime and let a, b be integers
not divisible by p such that p | a − b. Then for all n ≥ 1, we have
v p (an − bn ) = v p (a − b) + v p (n)
Proof. Call a positive integer n ≥ 1 good if it satisfies the above condition. We proceed with a claim,
It is clear that 1 is good, so it suffices to show that any prime q is good. We divide this into two
cases,
Case 1. If q 6= p
It suffices to show that
aq − bq
= aq−1 + aq−2 b + · · · bq−1
a−b
is not divisible by p. But this is clear, since
Case 2. If p = q
We can assume that a = b + pk c for some integer k ≥ 1 and some positive integer c not divisible by
Lifting the Exponent Lemma (LTE) 18
v p (a p − b p ) = v p (pk+1 b p−1 c) = 1 + k = 1 + v p (a − b)
as desired.
Corollary 1.2.2 — Let p be an odd prime and let a, b be integers not divisible by p such that p | a + b.
Then for all odd positive integers n, we have
v p (an + bn ) = v p (n) + v p (a + b)
Now we have seen the case when p is an odd prime, but what about the case when p = 2? This case is
the most interesting, and surprisingly there is a theorem for that as well.
Theorem 1.2.3 — Let x and y be odd positive integers and let n be an even positive integer, then
2
x − y2
n n
v2 (x − y ) = v2 + v2 (n)
2
Proof. Write n = 2k a for some integer k ≥ 1 and some odd positive integer a. Then, we have
k−1 k−1
xn − yn = (xa − ya )(xa + ya )(x2a + y2a ) · · · x2 a + y2 a
and since for any c, d ∈ Z, we have c2 + d 2 ≡ 2 (mod 4), the previous relation yields
x2a −y2a
Finally since a, x, y are odd, it is easy to observe that x2 −y2
= x2(a−1) + · · · + x2(a−1) which is clearly
odd, and this completes the proof.
Now that we are clear with the theory part, let us move on to tackle some concrete and challenging
problems.
Lifting the Exponent Lemma (LTE) 19
Problem 1.2.1 (AoPS). Let k be a positive integer.Find all positive integers n such that
3k | 2n − 1
Solution. First, notice that 3 | 2n −1 then n is even number, n = 2m for some m ∈ N. Then 3k | 4m −1.
By lifting the exponent Lemma, V3 (4m − 1) = 1 +V3 (m) which gives V3 (m) ≥ k − 1. So the answer is
n = 2 · 3k−1 · l for any l ∈ N
Problem 1.2.2 (AoPS). Find all natural numbers k such that k first prime p1 , p2 , . . . , pk then there
are exist 2 numbers a,n satisfy
p1 p2 . . . pk − 1 = an
Solution. Assume that there exists (k, a, n) ∈ Z3+ with n > 1 and k ≥ 2 for which
k
∏ pi = an + 1.
i=1
which implies n < k. Since n > 1 is odd, we can take an odd prime divisor q of n. Since q < k, we
must have q | an + 1. Since q | n and q | an + 1, by LTE, we must have q2 — an + 1. This is clearly
impossible. Therefore, k = 1 is the only solution.
Problem 1.2.3 (AoPS). Let p > 2013 be a prime. Also let a and b be positive integers such that
p | a + b but p - (a + b)2 . If p2 | a2013 + b2013 , then find the number of positive integers n ≤ 2013
such that pn | a2013 + b2013 .
Solution. We can rewrite the first condition as v p (a + b) = 1. We must also have v p a2013 + b2013 ≥
2. Now, if p - a, b,Well I think you might like to remember something which we have read
Lifting the Exponent Lemma (LTE) 20
Exercise 1.2.1. Can you recall some corollary which will be useful here? Maybe take corollary
1.2.2 into action.
We don’t always like to solve our exercises however we spoil it by application of the corollary point
out before we get that
v p a2013 + b2013 = v p (a + b) + v p (2013) = 1,
a contradiction. Thus p | a, b and this implies that p2013 | a2013 + b2013 and so all values n ≤ 2013
satisfy pn | a2013 + b2013 and so the answer is 2013.
Problem 1.2.4 (2007 Brazil TST). Find all integer solutions to the equation
x7 − 1
= y5 − 1.
x−1
x7 −1
Claim— If x is an integer and p is a prime divisor of x−1 = y5 − 1 then we have p ≡ 1 (mod 7) or
p = 7.
Proof. p|x7 − 1 and p|x p−1 − 1 (Fermat’s Little Theorem).Let us assume that 7 does not divide
7 −1
p − 1.Then gcd(p − 1, 7) = 1,so p|xgcd(p−1,7) − 1 = x − 1,so xx−1 = 1 + x + .... + x6 ≡ 7 (mod p)
and hence we get p = 7.This completes the proof of the lemma.
x7 −1
Let k be a positive divisor of x−1 .Then k ≡ 0 (mod 7) or k ≡ 1 (mod 7).Let us assume that (x, y) is
7
−1
an integer solution of the equation.Then y − 1| xx−1 ⇒ y ≡ 1 (mod 7) or y ≡ 2 (mod 7)For the first
case,1 + y + y + y + y ≡ 5 (mod 7) while in the second case 1 + y + y2 + y3 + y4 ≡ 3 (mod 7).This
2 3 4
7 −1
contradicts the fact that a positive divisor of xx−1 must be congruent to 0 or 1 modulo 7.So we have
no solutions.
Problem 1.2.5 (American Mathematical Monthly). Let a, b, c be positive integers such that
c −bc
c | ac − bc . Show that c | aa−b .
Solution. Let v p (c) = k for some prime p and k ≥ 1. If p - a − b, then we obviously have
ac − bc
pk |
a−b
Lifting the Exponent Lemma (LTE) 21
When p = 2, we have
ac − bc
v2 = v2 (a − b) + v2 (a + b) + v2 (c) − 1 ≥ v2 (c) = k
a−b
and the problem is solved in all cases. This completes the proof.
Problem 1.2.6. Let n be a square-free integer. Show that there is no pair of coprime positive
integers (x, y) such that
(x + y)3 | (xn + yn )
Solution. Assume (x + y)3 | (xn + yn ) with gcd(x, y) = 1. We will derive a contradiction. First,
suppose n is even. If there is an odd prime p | (x + y), then xn + yn ≡ xn + (−x)n ≡ 2xn mod p, so p | x,
so p | y, contradiction. Since x and y are positive, the only possible way that there is no odd prime
p dividing x + y is if x + y is a power of 2. In this case, x and y are both odd since they are coprime,
so since n is even xn and yn are both 1 mod 8, it follows that v2 (xn + yn ) = 1, but v2 (x + y)3 ≥ 3,
so again we get a contradiction. Now suppose n is odd. If there is an odd prime p | (x + y), then
3v p (x + y) ≤ v p (xn + yn ). Then LTE gives
3v p (x + y) ≤ v p (xn + yn ) = v p (x + y) + v p (n) ≤ v p (x + y) + 1
has an odd number of terms, all of which are odd. So it is impossible for (x + y)3 to divide xn + yn ,
since the power of 2 on the left exceeds the power of 2 on the right.
Problem 1.2.7. Suppose a and b are positive real numbers such that a − b, a2 − b2 , a3 − b3 , . . . are
all positive integers. Show that a and b must be positive integers.
−b 2 2
Solution. Since a − b ∈ Z and a2 − b2 ∈ Z, a + b = aa−b ∈ Q. But then a = 21 (a − b) + 12 (a + b) and
b = 12 (a + b) − 12 (a − b) are rational numbers as well. Now, write a = xz and b = yz as quotients of
positive integers, with a common denominator. Choose z as small as possible. Then the conditions
Lifting the Exponent Lemma (LTE) 22
so
2n+1
≤ (x − y)(x + y)
n
and we get a similar contradiction. The conclusion is that there is no prime p dividing z. So z = 1
and a and b are both positive integers.
Problem 1.2.8 (Russia 1996). Find all positive integers n for which there exist positive integers
x, y and k such that gcd(x, y) = 1 and 3n = xk + yk .
Solution. Note that k must be odd (why?). Now, let p be a prime dividing x + y, clearly p
is odd. Then by corollary 1.2.2, we have that v p (3n ) = v p (xk + yk ) = v p (k) + v p (x + y) > 0, as
v p (x + y) ≥ 1 > 0. Thus, p | 3k , implying that p = 3. Thus x + y = 3m for some positive integer m.
Note that n = v3 (k) + m. We proceed with two cases,
Case 1. If m > 1.
We can prove by induction that 3a ≥ a + 2 for all integers a ≥ 1, and so we have v3 (k) ≤ k − 2 (if
v3 (k) = a, then v3 (k) + 2 = a + 2 ≤ 3a ≤ k). Let M = max(x, y). Since x + y = 3m ≥ 9, we have M ≥ 5.
Then
x + y k−1 1 m k−1
xk + yk ≥ M k = M · M k−1 ≥ ·5 = 3 ·5 > 3m · 5k−2 ≥ 3m+k−2 ≥ 3m+v3 (k) = 3n
2 2
, a contradiction.
Case 2. If m = 1.
Then x + y = 3, so x = 1 and y = 2 (or x = 2 and y = 1). Thus 31+v3 (k) = 1 + 2k . But note that
Lifting the Exponent Lemma (LTE) 23
and one can easily see that the only odd value of k > 1 satisfying the above inequality is k = 3. Thus,
(x, y, n, k) = {(1, 2, 2, 3), (2, 1, 2, 3)}, implying that the only value is n = 2.
Problem 1.2.9. (Iran 2008 Round 2) Let a be a natural number. Suppose that 4 (an + 1) is a
perfect cube for every natural number n. Prove that a = 1
Solution. If an odd prime p divides an + 1 for some n, then v p (an + 1) must be divisible by 3 , since
gcd(p, 4) = 1. This is the key insight.
The expression
v p (an + 1)
motivates us to try LTE and hence why not try ? So, we want the 3 conditions. By assumption,
p > 2. Also, p - a . We just want p | a + 1 and n odd. So let’s start by this assumption. Pick an odd
prime p divisor of a + 1, if it exists . Then by Fermat’s Little Theorem, p|a + 1|a pk + 1 for all k. So,
by LTE
v p a pk + 1 = v p (a + 1) + v p (k) + 1 ∀ odd k
We know this is divisible by 3 for all odd k (why do we need odd k? ). However, since v p (a + 1) +
1 is fixed, hence we can choose (odd) k such that v p (a + 1) + v p (k) + 1 6= 0 (mod3), which is a
contradiction. Hence, our assumption that a + 1 has an odd prime factor was false. So a + 1 can’t
have an odd prime factor.
Write a + 1 = 2k . Here’s the clever trick now: since gcd a2 + 1, a + 1 = gcd(a + 1, 2) = 2, hence a2 + 1
will have an odd prime factor p if k > 1 . So, you can repeat the process above with a2 instead of
a and still get a contradiction (convince yourself that this argument works). Hence, k = 1, meaning
a + 1 = 2, i.e. a = 1, as needed.
Claim— For any natural numbers a, f is either a-periodic (i.e. f (a + b) = f (b) for all b ∈ N) or
f (a)|a.
Lifting the Exponent Lemma (LTE) 24
Proof. Suppose that f (a + b) 6= f (b) for some b ∈ N. Consider any prime number p. Plugging
in n yields f (a)| f (a + b) − f (b). Thus, by Lifting The Exponent Lemma, if p is odd,
n−1 n−1
v p ( f (a)n ) ≤ v p f (a + b)a − f (b)a
nv p ( f (a)) ≤ v p ( f (a + b) − f (b)) + (n − 1)v p (a)
If p = 2, one would obtain nv2 ( f (a)) ≤ v2 ( f (a + b)2 − f (b)2 ) + (n − 1)v p (a) − 1. Either way,
v p ( f (a)) > v p (a) yields a contradiction for some n big enough, so in fact we have v p ( f (a)) ≤ v p (a)
for all p prime, and thus f (a)|a.
Otherwise, f (a + b) = f (b) for all b ∈ N and f would be a-periodic.
Returning back to the main problem, the lemma implies that if f (1) 6= 1, then f is 1-periodic and
thus constant. So, now we assume f is non-constant, and thus f (1) = 1. By the first point, f cannot
be periodic; otherwise there exists n ≥ M such that f (n) = 1.
Now, fix a positive integer a, and let p be a prime number with p > max{M, a}. Then, since f (p) 6= 1,
we have f (p) = p. Hence,
p| f (p + a) − f (a)
But 0 < f (p + a) ≤ p + a < 2p and 0 < f (a) ≤ a < p, so −p < f (p + a) − f (a) < 2p and thus we get
either f (p + a) = f (a) or f (p + a) = p + f (a). However, if f (p + a) = f (a), then f (p + a) divides both
p + a and a. But gcd(p + a, a) = gcd(p, a) = 1, so f (p + a) = 1. But p + a ≥ M; a contradiction.
Hence, f (p + a) = p + f (a), so p + f (a)|p + a. Since p + f (a) > p+a 2 , then p + f (a) = p + a and thus
f (a) = a.
Since this holds for all a ∈ N, we conclude that f is the identity function on N.
Zsigmondy’s Theorem 25
This is the last section of this chapter. To make this chapter firm, we employ one of the strongest
techniques in Olympiad Number Theory, the celebrated Zsigmondy’s Theorem. This theorem has cracked
numerous amount of challenging Olympiad problems around the world, such as USA(J)MO, IMO, Bulgaria,
Balkan, China, India, and many more. This technique lies in the heart in one of the author. We hope
you will be able to learn how and when to employ this new technique, though we haven’t included the proof.
Before the main theorem, we state what a primitive prime factor is.
Theorem 1.3.1 (Zsigmondy) — Let a and b be relatively prime positive integers. Then, an − bn
always has a primitive prime factor for n ∈ N with the following exceptions,
• 26 − 16
• n = 2 and a + b is a power of 2
Theorem 1.3.2 (Zsigmondy’s Variant) — Let a and b be relatively prime positive integers. Then,
there exists a primitive prime factor of an + bn , where n ∈ N with the following exception: 23 + 13
Note. The proof of this uses Zsigmondy, we hope the reader can prove this.
Now that we are clear with the basics, we move on to tackle some concrete problems.
Problem 1.3.1 (Poland 2010). Let p and q be prime numbers with p > q > 2. Prove that 2 pq − 1
has at least three prime factors.
Solution. First, note that 2 p − 1 and 2q − 1 are divisors of 2 pq − 1, so we have at least two prime
factors with us. Now, since p > q > 2, by Zsigmondy, we have that 2 pq − 1 has a primitive prime
factor, and hence we have at least three prime factors in addition, completing the proof.
Zsigmondy’s Theorem 26
Problem 1.3.2 (IMO 2000 Shortlist). Find all triples (a, m, n) of positive integers that satisfy
the divisibility condition
am + 1 | (a + 1)n
Solution. If a = 1 then the divisibility condition obviously work. Assume now that a ≥ 2. If m = 1
then the divisibility condition obviously work. Assume now that a ≥ 2, m ≥ 2. If the two conditions
a = 2, m = 3 are not both true then by Zsigmondy’s there must exist a prime factor p of am + 1 which
does not divide a + 1 (and of course so does not (a + 1)n ). Hence there is no solution in this case. It
suffices for us to consider the single case a = 2, m = 3, in which only all n ≥ 2 satisfy the divisibility
condition. Therefore the solutions are only (1, m, n), (a, 1, n), (2, 3, k) where k ≥ 2.
Problem 1.3.3. Find all natural numbers n, k, l, m with l > 1 such that
(1 + nk )l = 1 + nm
Solution. First, note that k < m. Next Zsigmondy guarantees the existence of a primitive prime
factor of nm + 1 except for n = 2 and m = 3. If n and m are not the respective values given, then
nm + 1 has a prime divisor not dividing nk + 1, a contradiction. If n = 2 and m = 3, we find that
(k, l, m, n) = (1, 2, 2, 3) is the only solution.
Problem 1.3.4 (AoPS). Let a and b be positive integers such that an + bn | cn holds for all n > 1,
then show that a = b.
Solution. Without loss of generality, let gcd(a, b) = 1 because we can just divide both sides of the
divisibility by gcd(a, b) if this is not true. By Zsigmondy’s theorem, for n ≥ 3 and a 6= b we must
have that an+1 + bn+1 has a prime factor that didn’t appear for ak + bk and 1 ≤ k ≤ n. However, the
number of prime factors of c is finite, so sooner or later we will run out of new prime factors of ak + bk ,
contradiction. The only other option is a = b, hence proved.
Problem 1.3.5 (Baltic Way 2012). Let d(n) denote the number of positive divisors of n. Find
all triples (n, k, p), where n and k are positive integers and p is a prime number, such that
nd(n) − 1 = pk .
Case 2. n ≥ 3.
f d(n) 6= 2, by Zsigmondy’s theorem, there exists a prime q such that q|nd(n) − 1, q - n − 1. Since
n − 1|nd(n) − 1, this is absurd. Hence d(n) = 2. Then (n + 1)(n − 1) = pk . For s > t ≥ 0,
n + 1 = ps
n − 1 = pt
which implies that 2 = pt (ps−t − 1).If t = 0,then p = 3, s = 1, n = 2 which is absurd. Thus t ≥ 1 and
p = 2,t = 1, s = 2, n = 3, k = 3. which satisfies the condition.
Problem 1.3.6 (Japan MO 2011). Find all of quintuple of positive integers (a, n, p, q, r) such that
an − 1 = (a p − 1) (aq − 1) (ar − 1).
Case 2.2.1 n = 2
Thus, p = q = r = 1 and (a2 − 1) = (a − 1)3 , which implies to and is implied by a = 0, 3. Then a = 3,
and so (3, 2, 1, 1, 1) satisfies the condition.
Case 2.2.2 n ≥ 3
If not (a, n) = (2, 6), by Zsigmondy’s theorem there is prime number p0 such that p0 |an − 1, p0 -
a p −1, p0 - aq −1, p0 - ar −1 which is absurd. Hence (a, n) = (2, 6) and 32 7 = (2 p −1)(2q −1)(2r −1).By
6 > p, q, r,then (p, q, r) = (3, 2, 2), (2, 3, 2), (2, 2, 3).(2, 6, 3, 2, 2), (2, 6, 2, 3, 2), (2, 6, 2, 2, 3) satisfy the
condition.
Well you can point out yourselves the answer now by looking over the cases.
The p-adic valuation of n! (factorial-n) CHAPTER 2. LEGENDRE’S FORMULA 28
Chapter 2
Legendre’s Formula
In this chapter, we will discuss Legendre’s formula, which finds the p-adic valuation of n!. After fully
understanding the Legendre’s formula, we will move on to some beautiful applications of Legendre’s.
In this section, we aim to find the exact formula of v p (n!) for any prime p. Now, if you note that the
number of multiples of p in the first n consecutive naturals is just b np c, implying that is the power of
p in n!. But what about multiples of p that are multiples of p2 or p3 ? This means that the answer is
definitely not b np c, so there is a slight catch to evaluate the number v p (n!), or the exponent of p in the
prime factorisation of n! . The proof of Legendre uses just this basic fact, but it’s applications are really
diverse.
Theorem 2.1.1 (Legendre) — For all primes p and positive integers n, we have
∞
n
v p (n!) = ∑ i
i=1 p
Problem 2.1.1 (China 2004 TST). Let m1 , m2 , . . . , mr and n1 , n2 , . . . , ns be positive integers such
that for any integer d > 1, there are more or equal multiples of d in m1 , m2 , . . . , mr than those of
n1 , n2 , . . . , ns . Prove that n1 n2 · · · ns | m1 m2 · · · mr .
where the above equation follows from equivalent arguments as in the proof of Legendre’s Formula.
Problem 2.1.2 (USAMO 2016). Prove that for any positive integer k,
k−1
j!
(k2 )! · ∏
j=0 ( j + k)!
is an integer.
1!···(k−1)!
Solution. We need to prove that (k2 )! · k!···(2k−1)! ∈ Z. Applying Legendre’s formula, it suffices to
prove
k−1 2 k−1
k+i k i
∑ pi ≤ pi + ∑ pi ,
i=0 i=0
for any p < 2k prime. Since bac + 1 > a so it’s suffices to prove that
k2 k−1
k+ j j
>∑ − i .
pi j=0 pi p
We prove this by induction. Assume that it’s true for k, we need to prove that it’s also true for k + 1,
or
k
(k + 1)2
k+1+ j j
>∑ − i .
pi j=0 p i p
The p-adic valuation of n! (factorial-n) 30
(k + 1)2 k2 2k + 1
= i+ ,
pi p pi
k−1
k+ j j 2k + 1
≥∑ i
− i +1+ ,
j=0 p p pi
k
k+1+ j j 2k + 1 2k + 1 k 2k
=∑ − i + − + 2 i − i +1 ,
j=0 pi p pi pi p p
k
k+1+ j j
≥∑ i
− i .
j=0 p p
We are done.
is an integer.
which reduces to
n−1 al ai − 1
≥∑ +
pj l6=i pj pj
But this follows from the fact that for any reals a and b, we have
ba + bc ≥ bac + bbc
We will look over a cool theorem that can be used to solve many cool problems using p-adic valuations
that are ’inequality based’. But the proof of this is beyond the scope of this handout.
We show one cool example implying it’s importance! The example is from MEMO of year 2015.
Problem 2.1.4 (MEMO 2015). Find all pairs (a, b) of positive integers such that
ab + ba = a! + b!
Solution. WLOG, let a ≤ b. If a = 1, the equation becomes b! = b, so (a, b) = (1, 1), (1, 2), (2, 1).
Suppose now that a ≥ 2. Then, ab − b! = ba − a! ≥ aa − a! > 0, thus b! > ab . On the other hand, by
AM-GM Inequality, we have that
b(b + 1) b b+1 b
b! = 1 · 2 · 3 · · · b ≤ =
2b 2
which implies that 2a < b + 1. Thus, b ≥ 2a.
Suppose p be a prime divisor of a. Then, p | a! + b! and p | ab and hence p | b. Therefore, v p (ab + ba ) ≥
a. On the other hand, since b ≥ 2a, we have that p | (a + 1) · (a + 2) · · · b, hence
Exercise 2.1.1. Can you determine how the last inequality follows? In case search in context
previously in this handout !
But this gives a < a, a contradiction. Thus the only solutions are (a, b) = (1, 1), (1, 2), (2, 1).
Introduction and LTE CHAPTER 3. PRACTICE PROBLEMS 33
Chapter 3
Practice Problems
We have now come to the end of the handout, and we therefore conclude with a set of practice problems.
a | b2 | a3 | b4 · · ·
Show that a | b.
Exercise 3.1.5 (Polish Junior). Let a and b be positive odd integers such that ab ba is a perfect
square. Show that ab is a perfect square.
Exercise 3.1.6. Find all positive integers a and b such that a + b3 b + a3 is a power of 3.
Exercise 3.1.7 (Iran TST 2013). Find all arithmetic progressions a1 , a2 , · · · of positive integers for
which there is an integer N > 1 such that for all k ≥ 1,
a1 a2 · · · ak | aN aN+1 · · · aN+k
Exercise 3.1.8 (Canada). Find all positive integers n such that 2n−1 | n!
Exercise 3.1.9 (2019 USA TSTST). Let f : Z → {1, 2, . . . , 10100 } be a function satisfying
for all integers x and y. Show that there exist positive integers m and n such that f (x) = gcd(m + x, n)
for all integers x.
Exercise 3.1.10 (RMM 2018). Let a, b, c, d be positive integers such that ad 6= bc and
gcd(a, b, c, d) = 1. Prove that as n runs through the positive integers, the value gcd(an + b, cn + d)
may achieve, form the set of all positive divisors of some integer.
Introduction and LTE 35
Exercise 3.1.11 (China 2016 TST). Let c, d ≥ 2 be naturals. Let {an } be the sequence satisfying
a1 = c, an+1 = adn + c for n = 1, 2, · · · . Prove that for any n ≥ 2, there exists a prime number p such
that p|an and p 6 |ai for i = 1, 2, · · · n − 1.
Exercise 3.1.14 (2012 ARMO). For a positive integer n define Sn = 1! + 2! + . . . + n!. Prove that
there exists an integer n such that Sn has a prime divisor greater than 102012 .
Exercise 3.1.15. Call a sequence of positive integers {an } good if for any distinct positive integers
m, n, one has
gcd(m, n) | a2m + a2n and gcd(am , an ) | m2 + n2 .
Call a positive integer a to be k-good if there exists a good sequence such that ak = a. Does there
exists a k such that there are exactly 2019 k-good positive integers?
Exercise 3.1.16 (BMO 2018). Find all primes p and q such that 3pq−1 + 1 divides 11 p + 17 p
Exercise 3.1.18 (2013 JBMO TST). Find all positive integers x, y, z with z odd, which satisfy the
equation:
2018x = 100y + 1918z
Exercise 3.1.19 (2010 Indonesia TST). Let n be a positive integer with n = p2010 q2010 for two odd
√
primes p and q. Show that there exist exactly 2010 n positive integers x ≤ n such that p2010 |x p − 1
and q2010 |xq − 1.
Exercise 3.2.1 (2017 Japan TST). Find all positive integers k such that there exist positive integer
sequences a1 , a2 , . . . and r1 , r2 , . . . satisfying the following conditions: - a1 < a2 < a3 < . . . - ak1 + ak2 +
. . . + akn = (a1 + a2 + . . . + an )rn holds for all positive integers n
Exercise 3.2.2. Find all pairs of natural numbers (m, n) for which 2m 3n + 1 is the square of some
integer.
Exercise 3.2.3. Let p1 , p2 , . . . , pn be distinct primes greater than 3 . Show that 2 p1 p2 ···p3 + 1 has at
least 4n divisors.
Exercise 3.3.1 (Saint Petersburg 2007). Find all positive integers n and k for which
1n + 2n + · · · + nn = k!
Legendre’s Formula 37
Exercise 3.3.3 (Russia 2012). Prove that there is a positive integer n such that 1! + 2! + · · · + n!
has a prime factor greater than 102012
Exercise 3.3.4 (2007 Romania TST). Solve over the positive integers, the equation
x2007 − y2007 = x! − y!
Exercise 3.3.5 (Mathematical Reflections). Define a sequence (an )n≥1 by a1 = 1 and an+1 =
2n (2an − 1). Prove that n! | an for all n ≥ 1.
Legendre’s Formula 38
References
[6] MONT