Find the prime numbers $p, q$ satisfy: $p^2+3pq+q^2+6q+6p-60$ is perfect square
My try: $p^2+2pq+q^2+6q+6p+9+pq-69=r^2$ so $pq-69=(r-q-p-3)(r+p+q+3)$ and I stuck here, any hint please. Thank you.
Find the prime numbers $p, q$ satisfy: $p^2+3pq+q^2+6q+6p-60$ is perfect square
My try: $p^2+2pq+q^2+6q+6p+9+pq-69=r^2$ so $pq-69=(r-q-p-3)(r+p+q+3)$ and I stuck here, any hint please. Thank you.
Copyright © 2021 JogjaFile Inc.
The expression is
$$p^2+3pq+q^2+6q+6p-60 = r^2 \tag{1}\label{eq1A}$$
Using modulo $3$, we get
$$p^2 + q^2 \equiv r^2 \pmod{3} \tag{2}\label{eq2A}$$
Since perfect squares are congruent to $0$ or $1$ modulo $3$, if both $p$ and $q$ were not $3$, then the left side of \eqref{eq2A} would be congruent to $2$ modulo $3$. Thus, at least one of them must be $3$. Due to the symmetry between $p$ and $q$ in \eqref{eq1A}, WLOG have $p = 3$. Next, multiply both sides by $4$ to get
$$\begin{equation}\begin{aligned} 4r^2 & = 36 + 36q + 4q^2 + 24q + 72 - 240 \\ & = 4q^2 + 60q - 132 \\ & = 4q^2 + 60q + 225 - 225 - 132 \\ & = (2q + 15)^2 - 357 \end{aligned}\end{equation}\tag{3}\label{eq3A}$$
This leads to
$$(2q + 15)^2 - (2r)^2 = 357 \; \to \; (2q + 15 - 2r)(2q + 15 + 2r) = 3(7)(17) \tag{4}\label{eq4A}$$
To check the various factor possibilities (note since $2q + 15 + 2r \gt 0$, they'll both be positive), we have
$$2q + 15 - 2r = f_1 \tag{5}\label{eq5A}$$ $$2q + 15 + 2r = f_2 \tag{6}\label{eq6A}$$
with $f_1 f_2 = 357$, $f_1 \lt f_2$ and $f_1, f_2 \in \{1, 3, 7, 17, 21, 51, 119, 357\}$. Adding \eqref{eq5A} and \eqref{eq6A} gives
$$4q + 30 = f_1 + f_2 \; \; \to \; \; q = \frac{f_1 + f_2 - 30}{4} \tag{7}\label{eq7A}$$
This gives $q = \frac{1 + 357 - 30}{4} = 82$, $q = \frac{3 + 119 - 30}{4} = 23$, $q = \frac{7 + 51 - 30}{4} = 7$ or $q = \frac{17 + 21 - 30}{4} = 2$. Since only $2$, $7$ and $23$ are prime (with corresponding $r$ values of $1$, $11$ and $29$) then, along with switching $p$ and $q$ around, results in what Jan Eerland's question comment indicates, i.e.,
$$(p, q) \in \{(3,2),(2,3),(3,7),(7,3),(3,23),(23,3)\} \tag{8}\label{eq8A}$$