Find all ordered triplets $(p,q,r)$ of positive integers such that $p$ and $q$ are two (not necessarily distinct) primes, $r$ is even, and \[p^3+q^2=4r^2+45r+103.\]
Problem
Source: Pan-American Girls’ Mathematical Olympiad 2022, Problem 2
Tags: number theory, PAGMO, Diophantine equation
28.10.2022 00:11
28.10.2022 02:49
The first step is to read the problem carefully enough to notice that $r$ is even, otherwise you may be sad like me. Thus either $p=2$ or $q=2$. If $p=2$ the equation reads \[ q^2=4r^2+45r+95 \iff 16q^2=(8r+45)^2-505 \iff 505=(8r+45)^2-(4q)^2 \]which is a difference of squares. As $505=5\cdot101$, bash to get no solutions. If $q=2$ the equation is miraculously a difference of squares again: \begin{align*} p^3=4r^2+45r+99 &\iff 16p^3=(8r+45)^2-21^2=(8r+24)(8r+66) \\ \iff p^3 = (r+3)(4r+33). \end{align*}Since $\gcd(r+3,4r+33) = \gcd(r+3,21)$ by Euclidean algorithm, we must have either $p=3$ or $p=7$. Checking both we see only $p=7$ works, giving $(p,q,r) = (7,2,4)$.
30.10.2022 00:39
I'm the author of this problem. This is the official solution I submitted. Note that $p$ and $q$ must have different parity, so $p = 2$ or $q = 2$. If $q = 2$ we have $p^3 = 4r^2 + 45r + 99$ $=$ $(r+3)(4r + 33)$ has $4$ divisors which are $1, p, p^2$ and $p^3$. Since $1<r+3 < 4r+33$ are also divisors, $p = r+3$ and $p^2 = 4r+33$, and solving the system we obtain $p = 7$ and $r = 4$. Then, if $p = 2$ we have that $4r^2+45r$+$(95-q^2)=0$, and since $r$ must be an integer $\triangle$ $ = 45^2-16(95-q^2) = n^2 $ for some $n$ $ \iff$ $ (n+4q)(n-4q) = 505 $ , and since $ n+4q>n-4q$ and both must be positive we have that $n + 4q = 505$ and $ n-4q=1$ or $n + 4q = 101$ and $ n-4q=5$, obtaining $(n, q) = (253, 63)$ and $(n, q) = (53, 12)$ respectively, and since in no case $q$ is prime there is no solution in this case, and the only solution is $(p, q, r) = (7, 2, 4) \blacksquare $.
30.10.2022 06:03
As we see that $r$ is even, the right hand side is odd. Now, if $p$ and $q$ are both odd, then we have $p^3+q^2$ is even, a contradiction. If $p=2,$ then $q^2=4r^2+45r+95.$ Now since $r>1,$ we have $q^2>4r^2+40r+100=(2r+10)^2.$ $(2r+12)^2=4r^2+48r+144>q^2,$ thus we must have $4r^2+45r+95=4r^2+44r+121,$ and $r=26.$ Now what is $q.$ $q$ will be $2r+11=63,$ unfortunately not a prime. Thus, $q=2,$ so $p^3=4r^2+45r+99.$ If we factorize it, $p^3=(r+3)(4r+33).$ These two have gcd at most $21,$ so we must have $p=3$ or $p=7.$ $p=3$ is obviously too small $p=7$ gives the only solution. $(7,2,4).$
02.11.2022 01:18
For $p=2$ doesn´t it suffice to check $mod 3$?
02.11.2022 01:57
You end up with something like $1\equiv q^2\equiv\frac{r^2}4+2$, which I don't think is useful.
02.11.2022 21:59
jasperE3 wrote: You end up with something like $1\equiv q^2\equiv\frac{r^2}4+2$, which I don't think is useful. $q^2\equiv 4r^2+45r+95\equiv r^2+2\mod3$ $r^2\equiv 0$ or $1 \mod3$ Since $q$ is prime, and it is easy to check that $q \ne 3$ then $r^2 \not\equiv 1 \mod3$ $r^2 \equiv 0 \mod3$ has no solution for $q^2$
03.06.2024 11:19
LuisXender wrote: For $p=2$ doesn´t it suffice to check $mod 3$? I even got confused because no one here was using it.
23.07.2024 07:54
First, as $r$ is even, $4r^2+45r+103$ is odd, so if $p, q$ are both odd primes, $p^3+q^2$ would be even, absurd. Thus, $p$ or $q$ is $2$. If $p=2$, we get $8+q^2= 4r^2+45r+103\implies q^2= 4r^2+45r+95\equiv r^2+2 \pmod{3}$. If $3\mid r$, $q^2\equiv r^2+2\equiv 2 \pmod{3}\implies r^2\equiv 2\pmod{3}$, absurd. Then, $3\nmid r$ and $q^2\equiv 0 \pmod {3}\implies q=3$, but $9<4r^2+45r+95$, obviously. Which means no solution in this case. If $q=2$, we get $p^3+4= 4r^2+45r+103\implies p^3= 4r^2+45r+99= (r+3)(4r+33)$. Then, $r+3\mid p^3\implies r+3= \{1, p, p^2, p^3\}$. Similarly, $4r+33\mid p^3$. But $r+3, 4r+33>1\implies \{r+3, 4r+33\}= {p,p^2}$. As $4r+33>r+3$, we must have $\begin{cases} r+3= p\\ 4r+33= p^2 \end{cases}$. Now, $4r+33= p^2= (r+3)^2= r^2+6r+9\implies r^2+2r-24= 0\implies r=4$, as $r>0$. With that, we get $\boxed{p=7}$ Therefore, unique solution $\boxed{(p,q,r)= (7, 2, 4)}$