Prime Divisors Special
Prime Divisors Special
Prime Divisors Special
Author
The 2015 WOOTer
1
Introduction
In this article, we will explore some results about prime factors of numbers of the form
an − bn
.
a−b
The first chapter will consist of a review of basic facts, and in the later chapters ideas will be
presented along with problems from past competitions.
There is one final note to make: p, q are understood to be primes, even though it is not stated.
2
2
Basic Background
Theorem 2.1. For any positive integer k not divisible by p, the set {k, 2k, ...(p − 1)k} is equivalent
to the set Sp when elements are taken mod p.
Solution. Clearly {k, 2k, ...(p − 1)k} and Sp have the same number of elements. If we show each
element of {k, 2k, ..(p − 1)k} is equivalent to a different element within Sp , then the proof will
complete.
Assume this is not true. Then for some distinct a, b mod p, we must have ka ≡ kb (mod p).
This becomes k(a − b) ≡ 0 (mod p) and as p does not divide k, we must have a ≡ b mod p,
contradiction.
Theorem 2.2. The set {1−1 , 2−1 , ..(p − 1)−1 }, where inverses are taken mod p, is equivalent to Sp .
Solution. Clearly the two sets have equal magnitude, so it suffices to show that each element in
{1−1 , 2−1 , ..(p − 1)−1 } maps to a distinct element within Sp .
To show this, assume for the sake of contradiction that two a, b distinct mod p satisfy a−1 ≡
−1
b ≡ k (mod p) for some k. Then clearly ka ≡ kb ≡ 1 by the definition of an inverse. Thus,
we obtain k(a − b) ≡ 0 but since k cannot be divisible by p, it follows that a − b ≡ 0 , a
contradiction.
3
3
4
Prime Divisors of Special Numbers The 2015 WOOTer Page 5
Example 3.1. Show that there are infinitely many primes of the form 4k + 1.
Solution. This is very interesting.. Theorem 3.1 does not give any results concerning numbers that
are 1 mod 4 (where we substitute n = 4).
However, we may note that all primes are either equal to 2 or are 1, 3 mod 4.
Now assume, for the sake of contradiction, that there are only finitely many primes of the
form 4k + 1. We label these primes p1 , p2 , ..pm . Now consider the number N = (2p1 p2 ...pn )2 + 12 .
It is evident that this number is 1 mod 4. Suppose that this number is not prime. Then it
follows that it has an odd prime divisor q.
Suppose q is 1 mod 4. Then q must equal one of the pi s because p1 , p2 , ..pn is the complete
list of primes which are 1 mod 4. However, it is evident for each pi that gcd(N, pi ) = 1, so it is
impossible to have q|N .
Suppose now that q is 3 mod 4. Now it is easy to see where we are going. Apply corollary 2 of
theorem 3.1 to obtain that q| gcd(2p1 p2 ..pn , 1) = 1. Then this is a contradiction.
Because N is odd and has no prime factors of the form 1 mod 4 or 3 mod 4, it must be prime,
and furthermore it is a prime of the form 1 mod 4. But we assumed that p1 , p2 , ..pn was the
complete list of all primes which are 1 mod 4 and clearly N > pi for each i so it follows that there
is a contradiction and there are infinite primes of the form 1 mod 4.
Prime Divisors of Special Numbers The 2015 WOOTer Page 6
Solution. We assume there is a solution and rewrite the equation in the form (4a−1)(4b−1) = c2 +1.
This is clearly equivalent with the original equation.
Note that 4a − 1 is 3 mod 4. It must have a prime factor p which is 3 mod 4. (Because if this
were not the case, then 4a − 1 could not be 3 mod 4. ) Then p|c2 + 1 so by Corollary 2 of theorem
3, it follows that p| gcd(c, 1) = 1, which is a contradiction.
Thus, there can be no positive integer solutions to the diophantine.
The following problem is from the Kolmogorov Cup
Example 3.3. Suppose there exists three positive integers a, b, c such that the number N =
a2 + b 2 + c 2
is also an integer. Prove that N cannot be divisible by 3.
ab + bc + ca
Solution. Assume, for the sake of contradiction, that 3|N and write N = 3k. Also assume
gcd(a, b, c) = 1.
(a + b + c)2
Then it is not hard to show 3k + 2 = .
ab + bc + ca
Note the left hand side must have a prime factor p ≡ 2 mod 3 such that p divides 3k + 2 an
odd number of times. (Because if this is not the case, one may prime factorize 3k + 2 and take
mod 3 to show that 2 ≡ 1.)
However, if p|3k + 2 it follows that p|(a + b + c)2 . Now note p divides (a + b + c)2 an even
number of times as (a + b + c)2 is a square. It follows that p|ab + bc + ca (an odd number of times,
but this is insignificant).
We now know a + b + c ≡ 0 and ab + bc + ca ≡ 0 mod p. Substitute c = −a − b into the second
equation to obtain −(a2 + ab + b2 ) ≡ 0 mod p. However, by Corollary 1 of Theorem 3.1, we obtain
p| gcd(a, b).
Similarly, we obtain p| gcd(b, c) (or by symmetry on a, b, c ). It follows that p| gcd(a, b, c).
However, we assumed gcd(a, b, c) = 1 so we have a contradiction!
Example 3.4. Determine all positive integers n such that there exists a positive integer m
with 2n − 1|m2 + 9.
Solution. Firstly, note n = 1 obviously works. Now assume n > 1. Then 2n − 1 is 3 mod 4 and it
must have a factor that is 3 mod 4. Let this factor be p, and then p|2n − 1|m2 + 9 so it follows that
p| gcd(m, 3) and p = 3. We also obtain 3|m. Then substitute m = 3M so that 2n − 1|9(M 2 + 1).
Now, here comes the trick: Firstly, 3|2n − 1 =⇒ n is even. Suppose n = 2, then clearly this
satisfies the conditions. (We can choose m = 3). Suppose then n > 2 and therefore n is composite.
Write n = 2a · b, where b is odd.
Then 2b − 1|2n − 1|m2 + 9. Suppose b > 1. Then 2b − 1 has a prime factor which is 3 mod 4.
Call it q. Then q|m2 + 9 so it follows that q| gcd(m, 3) = 3 by Corollary 2. But b is odd so q 6= 3
and we have a contradiction. It follows that b = 1 and n = 2a .
Putting all our solutions together, n can equal 1, 2, or 2a . We can merge these all into one
solution set: n = 2x for nonnegative x.It will be left to the reader to verify that all n = 2x work.
Prime Divisors of Special Numbers The 2015 WOOTer Page 7
Example 3.5. This one is a joke. Determine all positive integers n such that there exists m
with 3n − 1|m2 + 5m + 25.
Solution. You should be able to copy all of the previous solution except use Corollary 1 instead of
Corollary 2 and tweak some numbers.
Note there exists a prime p ≡ 2 mod 3 with p|3n − 1|m2 + 5m + 25 so Corollary 1 yields
p| gcd(m, 5). Now it follows that p = 5 and then 5|m. Substitute m = 5M and we obtain
3n − 1|25(M 2 + M + 1). Now write n = 2a · b where b is odd.
It follows that 3b − 1|3n − 1|25(M 2 + M + 1). Since b is odd, we cannot have 5|3b − 1. However,
some prime q in the form 2 mod 3 must divide 3b − 1 so it follows that q|25(M 2 + M + 1) =⇒
q|M 2 + M + 1 and Corollary 1 tells us q| gcd(M, 1), which is impossible.
Thus, there are no solutions.
As mentioned, this final problem was a joke meant to emphasize the technique involved.
Now, one may ask, why did we only select problems involving Corollaries 1 and 2? Theorem
3.1 is a very general theorem, yet we only selected applications where n = 3, 4.
There are several reasons for this.
1. 3,4 are small. The advantage of this is that we can ”force” the theorem to work. As seen,
if N ≡ 2 mod 3, then we know there must be a prime factor of N which is 2 mod 3. If we
knew N ≡ 5 mod 13, it would be very difficult to derive something significant from which
the theorem could be applied.
2. Let us look at what happens when N = 6. Then the theorem tells us that some prime
a6 − b 6
factors divide = (a + b)(a2 − ab + b2 )(a2 + ab + b2 ). However, we may recognize
a−b
a2 − ab + b2 , a2 + ab + b2 as factors which originate from theorem 3.1 for n = 3! Because 3|6,
we can see that theorem 3.1 when applied for n = 6 ”degenerates” into theorem 3.1 applied
for n = 3.
4
When n is prime
Example 4.1. Show that all prime factors of 2p − 1 are greater than p.
2p − 1
Solution. Note by Theorem 4.1 that q| =⇒ q = p or q ≡ 1 mod p.
2−1
Suppose p = q. We obtain 2p ≡ 1 mod p but coupled with 2p−1 ≡ 1 mod p we obtain 2 ≡ 1
mod p which implies p = 1, impossible.
8
Prime Divisors of Special Numbers The 2015 WOOTer Page 9
Suppose q ≡ 1 mod p then. Either q > p or q = 1. The second case is impossible, so we have
shown all prime factors of 2p − 1 are > p.
The following example is a famous result.
Example 4.2. Show that pp − 1 has at least one prime divisor of the form 1 mod p.
pp − 1
Solution. It is evident that the number has prime factors either equal to p or ≡ 1 mod p.
p−1
pp − 1
The first case is ridiculous, so we consider the second one. Suppose a prime q divides , then
p−1
q|pp − 1 and we know q ≡ 1 mod p so the claim is proven.
Indeed, this can certainly be generalized to the following statement: If a prime divisor of pp − 1
does not divide p − 1, then it is equivalent to 1 modulo p.
The proof is identical.
For the next problem, which appeared on the Romania TST, we would like to challenge the
reader to first attempt to solve it without using the ideas in this chapter. The contestants found
that it was almost impossible to solve with elementary methods alone.
Example 4.3. For a prime p ≥ 5, show that xp−1 + xp−2 + .. + x2 + x + 2 is not a perfect
square.
xp −1
Solution. We note the expression is equivalent to x−1
+ 1.
xp − 1
Suppose this equals a square, and let it be a2 . We obtain (a + 1)(a − 1) = .
x−1
Then by Theorem 4, all prime divisors of (a + 1)(a − 1) are equal to p or equal to 1 mod p.
It is quite obvious that this is impossible. (It implies that both of a + 1, a − 1 have only divisors
equal to p or 1 mod p, and thus, a + 1, a − 1 simultaneously can only equal 0 or 1 mod p. This is
obviously impossible as p ≥ 5).
The following problem is from the 2006 ISL.
x7 − 1
Example 4.4. Determine all integer solutions to the equation = y 5 − 1.
x−1
Solution. We take two cases: x ≡ 1 mod 7 and x is not equivalent to 1 mod 7.
x7 − 1
In the first case, it is apparent that = x6 + x5 + .. + 1 ≡ 0 mod 7. It follows that y 5 ≡ 1
x−1
mod 7 and we note that y 6 ≡ 1 mod 7 by Fermat’s Little Theorem. These two facts imply y ≡ 1
mod 7.
x7 − 1 x7 − 1
Here comes the trick- notice that y 5 − 1| so it follows that y 4 + y 3 + y 2 + y + 1| .
x−1 x−1
But because y ≡ 1 mod 7, it follows that y 4 + y 3 + y 2 + y + 1 ≡ 5 mod 7. Theorem 4.1 tells us that
all prime divisors of y 4 + y 3 + .. + 1 are 0, 1 mod 7 so this is impossible and there are no solutions.
x7 − 1
Then suppose that x is not equivalent to 1 mod 7. It follows that ≡ 1. Then we obtain
x−1
y 5 − 1 ≡ 1 =⇒ y 5 ≡ 2 =⇒ y ≡ 4 mod 7. (The last equivalence follows from y 5 ≡ 2 and it is not
hard to prove. One can substitute y ≡ 0, 1, 2, 3, 4, 5, 6 to prove it.)
Prime Divisors of Special Numbers The 2015 WOOTer Page 10
But clearly y − 1|y 5 − 1 and y ≡ 4 =⇒ y − 1 ≡ 3 so we have just shown that there is a divisor
x7 − 1
of which is 3 mod 7. This contradicts Theorem 4, so there cannot be any solutions.
x−1
Thus, we are done, and there are no solutions in positive integers to the equation.
4.3 A Generalization
We have shown the power of theorem 4.1 using the above examples. Now, it is natural to wonder
if the theorem can be generalized. It can be, but the generalization is not as useful.
ap − b p
Suppose a prime q divides . Then either q ≡ 1 mod p, p = q, or q|a, b.
a−b
Proof. We proceed as in the proof of Theorem 4.1 to obtain ap ≡ bp , aq−1 ≡ bq−1 mod q and it
follows that agcd(p,q−1) = bgcd(p,q−1) mod q.
Suppose that gcd(q − 1, p) = 1 and it follows that a ≡ b. Then by substituting this into the
congruence ap−1 + ap−2 b + .. + bp−1 ≡ 0 we obtain pap−1 ≡ 0 mod q. It follows that at least one of
p = q, q|a must hold. (And if q|a then clearly q|b)
Suppose that gcd(q − 1, p) = p and it follows that q ≡ 1 mod p. Note that this holds whenever
q|a − bp .
p
The problem with this generalization is that the case q|a, b makes it remarkably weak. This
makes it very hard to apply in problems, unless one is already given the condition gcd(a, b) = 1 in
which case it is as strong as Theorem 4.1.
Of course, there is another special case of this which is also useful. Namely, suppose b is prime.
Then the generalization states that q ≡ 1 mod p, p = q, or q = b.
5
As you have now seen many applications of theorems 3.1 and 4.1, try to solve the following problems
yourself.
1. In example 4 of section 3.3: We proved in the solution that all n that work must be powers
of 2. Prove the converse, which is that all powers of 2 must work.
11