Find all pairs of primes $(p,q)$ such that $6pq$ divides $$p^3+q^2+38$$
Problem
Source: Pan-American Girls’ Mathematical Olympiad 2023 P5
Tags: Divisibility
10.08.2023 00:28
AlanLG wrote: Find all pairs of primes $(p,q)$ such that $6pq$ divides $$p^3+q^2+38$$ $\color{blue}\boxed{\textbf{Answer: (3,5),(3,13)}}$ $\color{blue}\boxed{\textbf{Proof:}}$ $\color{blue}\rule{24cm}{0.3pt}$ $$6pq|p^3+q^2+38$$$$\Rightarrow 3|p^3+q^2+2$$$$\Rightarrow p\text{ or }q\equiv 0\pmod{3}$$$\color{red}\boxed{\text{If }p=3:}$ $$\Rightarrow q|q^2+65$$$$\Rightarrow q=5,13$$It is easy to see that they comply $$\Rightarrow (3,5),(3,13) \text{ are solutions}$$$\color{red}\boxed{\text{If }q=3:}$ $$\Rightarrow p|p^3+47$$$$\Rightarrow p=47$$Verifying does not comply $$\Rightarrow \boxed{(3,5),(3,13) \text{ are the only solutions}}_\blacksquare$$$\color{blue}\rule{24cm}{0.3pt}$
10.08.2023 00:37
Answer: \((p,q)=\left\lbrace(3,5),(3,13)\right\rbrace\). If \(p,q>3\), then \(p,q\equiv \pm 1 \pmod{6}\), which implies: \[p^3+q^2+38\equiv \pm 1+1+2\equiv \pm 1+3\not\equiv 0\pmod{6}\] Hence, at least one of \(p,q\) is less than or equal to \(3\) (\(p=2,q=2,p=3\), or \(q=3\)). Furthermore, we have \[2|6pq|p^3+q^2+38\Rightarrow 2 | p^3+q^2,\]indicating that \(p\) and \(q\) have the same parity. If \(p=q=2\), the condition is not fulfilled (\(24\not|(2^3+2^2+38)=50\)). If \(p=3\), then: \[18q | (3^3+q^2+38)=(q^2+65) \Rightarrow q|18q|(q^2+65)\therefore q|65\]This implies \(q=5\) or \(q=13\). Upon checking the values in the relation, both are solutions. If \(q=3\), then: \[12p | (p^3+3^2+38)=(p^3+47) \Rightarrow p|12p|(p^3+47)\therefore p|47\]This leads to \(p=47\). However, upon checking this pair in the relation, it doesn't hold.
13.08.2023 18:50
My solution is very similar to the ones above, however another possible way to discard the case of q=3 is simply looking the cubic residues mod 9, which are only 1,8 and 0. Since we know that 9 must divide p^3 + 47 since we know must 18p divide it, it implies that p^3 must be 7 mod 9, which does not happen.