Maths Olympiad Prep

Library / Junior Balkan MO /29 of 51

Junior Balkan MO

Number theory Difficulty 5.7 AIME, harder Prove it JBMO

Problem:
Find all pairs (p,q)(p, q) of prime numbers such that
1+pq−qpp+q 1+\frac{p^{q}-q^{p}}{p+q}
is a prime number.

Solution

Solution:
It is clear that p≠qp \neq q. We set
1+pq−qpp+q=r 1+\frac{p^{q}-q^{p}}{p+q}=r
and we have that
pq−qp=(r−1)(p+q) p^{q}-q^{p}=(r-1)(p+q)
From Fermat's Little Theorem we have
pq−qp≡−q( mod p) p^{q}-q^{p} \equiv -q \quad(\bmod p)
Since we also have that
(r−1)(p+q)≡−rq−q( mod p) (r-1)(p+q) \equiv -r q - q \quad(\bmod p)
from (3) we get that
rq≡0( mod p)⇒p∣qr r q \equiv 0 \quad(\bmod p) \Rightarrow p \mid q r
hence p∣rp \mid r, which means that p=rp=r. Therefore, (3) takes the form
pq−qp=(p−1)(p+q) p^{q}-q^{p}=(p-1)(p+q)
We will prove that p=2p=2. Indeed, if pp is odd, then from Fermat's Little Theorem we have
pq−qp≡p( mod q) p^{q}-q^{p} \equiv p \quad(\bmod q)
and since
(p−1)(p+q)≡p(p−1)( mod q) (p-1)(p+q) \equiv p(p-1) \quad(\bmod q)
we have
p(p−2)≡0( mod q)⇒q∣p(p−2)⇒q∣p−2⇒q≤p−2<p p(p-2) \equiv 0 \quad(\bmod q) \Rightarrow q|p(p-2) \Rightarrow q| p-2 \Rightarrow q \leq p-2<p
Now, from (4) we have
pq−qp≡0( mod p−1)⇒1−qp≡0( mod p−1)⇒qp≡1( mod p−1) p^{q}-q^{p} \equiv 0 \quad(\bmod p-1) \Rightarrow 1-q^{p} \equiv 0 \quad(\bmod p-1) \Rightarrow q^{p} \equiv 1 \quad(\bmod p-1)
Clearly gcd⁡(q,p−1)=1\operatorname{gcd}(q, p-1)=1 and if we set k=ord⁡p−1(q)k=\operatorname{ord}_{p-1}(q), it is well-known that k∣pk \mid p and k<pk<p, therefore k=1k=1. It follows that
q≡1( mod p−1)⇒p−1∣q−1⇒p−1≤q−1⇒p≤q q \equiv 1 \quad(\bmod p-1) \Rightarrow p-1 \mid q-1 \Rightarrow p-1 \leq q-1 \Rightarrow p \leq q
a contradiction.
Therefore, p=2p=2 and (4) transforms to
2q=q2+q+2 2^{q}=q^{2}+q+2
We can easily check by induction that for every positive integer n≥6n \geq 6 we have 2n>n2+n+22^{n}>n^{2}+n+2. This means that q≤5q \leq 5 and the only solution is for q=5q=5. Hence the only pair which satisfy the condition is (p,q)=(2,5)(p, q)=(2,5).

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.