$pq-6$, $qr-6$ and $rp-6$ are all perfect squares. Prove that $p+q+r-9$ is also a perfect square.

elementary-number-theory

$p$, $q$ and $r$ are distinct prime numbers such that $pq-6$, $qr-6$ and $rp-6$
are all perfect squares. Prove that $p+q+r-9$ is also a perfect
square.

Now comes a part where I explain what I have tried and concluded so far. In short: nothing, except that only one prime number can be 2. In fact, finding a working example proved to be a challenge. And this is not homework, I'm too old for it.

EDIT: Actually, I turned out to be smarter than I thought. Suppose that we have three odd primes $p,q,r$. In that case at least two are equal to 1 or 3 (modulo 4). In both cases their product is equal to 1 (modulo 4). Subtract 6 and and you get 3 (modulo 4). And such number cannot be a perfect square.

So at least one prime number has to be $2$, say $p$. I solved 1/3 of the problem. Probably enough to avoid downvotes 🙂

Best Answer

Let $p=2$ be the even prime and without loss of generality assume $p<q<r$. Since $p,q,r$ are primes this means $r\geq 5$.

We shall first show the following:

Lemma. Let $2=p<q<r$ be primes and $$ \begin{align} 2q-6 &= x^2\\ 2r-6 &= y^2\\ qr-6 &= z^2 \end{align} $$ for some integers $x,y,z\geq 0$. Then $$ z+y = r $$

Proof. Taking equations $2$ and $3$, we form the following: $$ \begin{align} z^2 &\equiv -6 \equiv y^2 \pmod r\\ (z+y)(z-y) &\equiv 0 \pmod r \end{align} $$ Therefore $r$ divides $z+y$ or $z-y$. We first assume the latter, then $$ \begin{align} z-y &\equiv 0 \pmod r\\ z &= y + kr \end{align} $$ for some $k\geq 0$ since $z> y$. But now $$ \begin{align} 0 &< y+kr=z =\sqrt{qr-6} < \sqrt{r^2} = r\\ 0 & < y+kr < r \implies k=0 \end{align} $$ This means that $$ z = y $$ which is not possible. Hence we must have instead $$ \begin{align} z+y &\equiv 0 \pmod r\\ z+y &= kr\\ 0 < kr &= z+y\\ &= \sqrt{qr-6}+\sqrt{2r-6}\\ &< \sqrt{r^2} + \sqrt{4r}\\ &= r+2\sqrt{r}\\ &< 2r\\ 0<kr &< 2r \end{align} $$ where the last equality is because $$ r\geq 5 \implies 4r < r^2 \implies 2\sqrt{r} < r $$ Therefore we must have precisely $k=1$, giving $z+y=r$.

$$ \tag*{$\square$} $$


We now show that

Proposition. Let $p=2$ and $$ \begin{align} 2r-6 &= y^2\\ qr-6 &= z^2\\ z+y &= r \end{align} $$ for some integers $q,r,y,z\geq 0$. Then $$ p+q+r-9 = (y-1)^2 $$

Proof. Using $z+y=r$, we have $$ \begin{align} r &= z+y\\ &= \sqrt{qr-6} + \sqrt{2r-6}\\ \sqrt{qr-6} &= r - \sqrt{2r-6}\\ qr-6 &= r^2-2r\sqrt{2r-6} + (2r-6)\\ qr &= r^2-2r\sqrt{2r-6} + 2r\\ q &= r -2\sqrt{2r-6} + 2\\ p+q+r-9 = q+r-7 &= (2r-5) -2\sqrt{2r-6}\\ &= (y^2+1) - 2y\\ &= (y-1)^2 \end{align} $$

$$ \tag*{$\square$} $$


Edit 1: Deriving a formula similar to Will Jagy's.

Proposition. Primes $q,r$ satisfies $$ \begin{align} q &= 2(6k\pm 1)^2+3 = 5 + 24u\\ r &= 2(6k\pm 2)^2+3 = 11 + 24v \end{align} $$ for some integers $u,v\geq 0$ (must be same sign). This in turn gives $$ \begin{align} x &= \sqrt{2q-6} = 2(6k \pm 1)\\ y &= \sqrt{2r-6} = 2(6k \pm 2)\\ z &= \sqrt{qr-6} = 72k^2\pm 36k+7\\ q+r-9 &= (3(4k\pm 1))^2 \end{align} $$

Proof. We start from $$ \begin{align} 2q-6&=x^2\implies -6\equiv x^2\pmod q\\ 2r-6&=y^2\implies -6\equiv y^2\pmod r \end{align} $$ Since $-6$ is a square, by Quadratic Reciprocity we get $q,r\equiv 1,5,7,11\pmod{24}$.

Now the third equation gives $$ qr-6 = z^2\implies qr=z^2+6 $$ Since $z^2+6\equiv 6,7,10,15,18,22\pmod{24}$, the only possible combinations of $(q,r)\pmod{24}$ are $$ (1,7),(5,11),(7,1),(11,5) $$ For $q\equiv 1,7 \pmod{24}$, we observe that $$ 2q-6 =x^2\implies 20,8\equiv x^2\pmod{24} $$ which is not possible. Therefore up to interchanging $q$ and $r$, we may assume that $$ (q,r)\equiv (5,11) \pmod{24} $$ Hence we now have $$ \begin{align} q &= 2a^2+3 = 5+24u\\ r &= 2b^2+3 = 11+24v \end{align} $$ for some integers $a,b,u,v\geq 0$. By checking $\pmod{24}$, we can show that $$ a = 6m\pm 1,\quad b = 6n\pm 2 $$ Further, using $q=r-2\sqrt{2r-6}+2$ as before: $$ \begin{align} q &= r-2\sqrt{2r-6}+2\\ 72 m^2 \pm 24 m + 5 &= 72 n^2 \pm 24 n + 5\\ 9 m^2 \pm 6 m + 1 &= 9 n^2 \pm 6 n + 1\\ (3m \pm 1)^2 &= (3n\pm 1)^2 \end{align} $$ it must be the case that $m=n=k$ and $6m\pm 1,6n\pm 2$ has the same sign. Then a direct computation gives the formula for $z$ and $p+q+r-9$.