Maths Olympiad Prep

Library / Korean Mathematical Olympiad Final Round /4 of 28

Korean Mathematical Olympiad Final Round

Number theory Difficulty 5.7 AIME, harder Prove it South Korea

Find all pair (p,q)(p, q) of primes such that pp+qq+1p^p + q^q + 1 is divisible by pqpq.

Solution

Clearly, p≠qp \ne q. So we may assume that p<qp < q without loss of generality. Assume that p=2p = 2. Then since
qq+5≡5≡0(modq), q^q + 5 \equiv 5 \equiv 0 \pmod{q},
the only possible prime for qq is 55. Furthermore, (p,q)=(2,5)(p, q) = (2, 5) satisfies the above condition. Now we assume that both pp and qq are odd primes. Since pp+1≡0(modq)p^p + 1 \equiv 0 \pmod{q}, pp−1−pp−2+⋯−p+1p^{p-1} - p^{p-2} + \dots - p + 1 is divisible by qq and p2p≡1(modq)p^{2p} \equiv 1 \pmod{q}. On the other hand, Fermat's Little Theorem says
pq−1≡1(modq). p^{q-1} \equiv 1 \pmod{q}.
If gcd⁡(2p,q−1)=2\gcd(2p, q-1) = 2, then p2≡1(modq)p^2 \equiv 1 \pmod{q}. Hence p≡1(modq)p \equiv 1 \pmod{q} or p≡−1(modq)p \equiv -1 \pmod{q}. Therefore
0≡pp−1−pp−2+⋯−p+1≡1(modq), 0 \equiv p^{p-1} - p^{p-2} + \dots - p + 1 \equiv 1 \pmod{q},
which is a contradiction. Assume that gcd⁡(2p,q−1)=2p\gcd(2p, q - 1) = 2p, that is, q≡1(modp)q \equiv 1 \pmod p. In this case we have
0≡pp+qq+1≡pp+1+1≡2(modp), 0 \equiv p^p + q^q + 1 \equiv p^p + 1 + 1 \equiv 2 \pmod{p},
which is again a contradiction.
Therefore (p,q)=(2,5)(p, q) = (2, 5) or (5,2)(5, 2) is the only pair of primes satisfying the above condition. □\square

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.