Maths Olympiad Prep

Library / /31 of 56

Number theory Difficulty 5.7 AIME, harder Prove it JBMO

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

Solution

Solution:
It is clear that pqp \neq q. We set
1+pqqpp+q=r 1+\frac{p^{q}-q^{p}}{p+q}=r
and we have that
pqqp=(r1)(p+q) p^{q}-q^{p}=(r-1)(p+q)
From Fermat's Little Theorem we have
pqqpq(modp) p^{q}-q^{p} \equiv -q \quad(\bmod p)
Since we also have that
(r1)(p+q)rqq(modp) (r-1)(p+q) \equiv -r q - q \quad(\bmod p)
from (3) we get that
rq0(modp)pqr r q \equiv 0 \quad(\bmod p) \Rightarrow p \mid q r
hence prp \mid r, which means that p=rp=r. Therefore, (3) takes the form
pqqp=(p1)(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
pqqpp(modq) p^{q}-q^{p} \equiv p \quad(\bmod q)
and since
(p1)(p+q)p(p1)(modq) (p-1)(p+q) \equiv p(p-1) \quad(\bmod q)
we have
p(p2)0(modq)qp(p2)qp2qp2<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
pqqp0(modp1)1qp0(modp1)qp1(modp1) 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,p1)=1\operatorname{gcd}(q, p-1)=1 and if we set k=ordp1(q)k=\operatorname{ord}_{p-1}(q), it is well-known that kpk \mid p and k<pk<p, therefore k=1k=1. It follows that
q1(modp1)p1q1p1q1pq 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 n6n \geq 6 we have 2n>n2+n+22^{n}>n^{2}+n+2. This means that q5q \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,000 problems in a working order, from AMC 10 level to the IMO shortlist.

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