Find all pairs [tex](p, q)[/tex] of prime numbers such that [tex]pq[/tex] divides [tex]5^p+5^q[/tex].
Solution:
We use Fermat's little theorem: [tex]5^r\equiv 5\pmod r[/tex] for every prime [tex]r[/tex]. The condition is symmetric in [tex]p[/tex] and [tex]q[/tex].
Case [tex]1[/tex]: [tex]p=5[/tex]. If [tex]q=5[/tex], then [tex]25\mid 2\times 5^5[/tex], so [tex](5, 5)[/tex] is a solution. If [tex]q\ne 5[/tex], divisibility by [tex]5[/tex] is automatic and [tex]5[/tex] and [tex]q[/tex] are coprime, so we need [tex]q\mid 5^5+5^q[/tex]. As [tex]5^q\equiv 5\pmod q[/tex], this means
[tex]q\mid 5^5+5=3130=2\times 5\times 313[/tex]
so [tex]q=2[/tex] or [tex]q=313[/tex] (the number [tex]313[/tex] is prime). Both work: [tex]5^5+5^2=3150=10\times 315[/tex], and [tex]5^5+5^{313}[/tex] is divisible by [tex]5[/tex] and, since [tex]5^5+5^{313}\equiv 3130\equiv 0\pmod{313}[/tex], also by [tex]313[/tex]. This gives [tex](5, 2)[/tex], [tex](5, 313)[/tex] and, by symmetry, [tex](2, 5)[/tex], [tex](313, 5)[/tex].
Case [tex]2[/tex]: [tex]p=2[/tex], [tex]q\ne 5[/tex]. The sum [tex]5^2+5^q[/tex] is even, and modulo [tex]q[/tex]
[tex]5^2+5^q\equiv 25+5=30\pmod q\ \Rightarrow\ q\mid 30[/tex]
so [tex]q\in\{2, \,3, \,5\}[/tex], i.e. [tex]q=2[/tex] or [tex]q=3[/tex]. For [tex]q=2[/tex]: [tex]4\nmid 50[/tex], rejected. For [tex]q=3[/tex]: [tex]5^2+5^3=150=6\times 25[/tex], so [tex](2, 3)[/tex] and, by symmetry, [tex](3, 2)[/tex] are solutions.
Case [tex]3[/tex]: [tex]p, q\notin\{2, \,5\}[/tex]. From [tex]p\mid 5^p+5^q[/tex] and [tex]5^p\equiv 5\pmod p[/tex] we get [tex]p\mid 5\left(5^{q-1}+1\right)[/tex], and since [tex]p\ne 5[/tex], [tex]p\mid 5^{q-1}+1[/tex]. In the same way [tex]q\mid 5^{p-1}+1[/tex]:
[tex]5^{q-1}\equiv -1\pmod p,\qquad 5^{p-1}\equiv -1\pmod q[/tex]
Let [tex]d[/tex] be the smallest positive integer with [tex]5^d\equiv 1\pmod p[/tex]; then [tex]5^k\equiv 1\pmod p[/tex] exactly when [tex]d\mid k[/tex]. We have [tex]d\mid p-1[/tex] (by Fermat's theorem), [tex]d\mid 2(q-1)[/tex] (because [tex]5^{2(q-1)}\equiv 1[/tex]) and [tex]d\nmid q-1[/tex] (because [tex]5^{q-1}\equiv -1\not\equiv 1[/tex], as [tex]p\gt 2[/tex]).
Let [tex]2^s[/tex] be the highest power of [tex]2[/tex] dividing [tex]q-1[/tex], and write [tex]d=2^t d'[/tex] with [tex]d'[/tex] odd. From [tex]d\mid 2(q-1)[/tex] we get [tex]d'\mid q-1[/tex] and [tex]t\le s+1[/tex]; if [tex]t\le s[/tex], then [tex]d\mid q-1[/tex], which is false. So [tex]t=s+1[/tex], and since [tex]d\mid p-1[/tex], also [tex]2^{s+1}\mid p-1[/tex]: the exponent of [tex]2[/tex] in [tex]p-1[/tex] is greater than in [tex]q-1[/tex].
Swapping the roles of [tex]p[/tex] and [tex]q[/tex], the exponent of [tex]2[/tex] in [tex]q-1[/tex] is greater than in [tex]p-1[/tex], a contradiction. So this case gives no solutions (including [tex]p=q[/tex]). All solutions:
[tex](2, 3),\ (3, 2),\ (2, 5),\ (5, 2),\ (5, 5),\ (5, 313),\ (313, 5)[/tex]