Find all solutions for $p^2+q^2+49r^2 = 9k^2 - 101$ [closed]

Looking at the equation modulo $3,$ we obtain $p^2+q^2+r^2\equiv 1\pmod 3.$ Now, since for any integer $n$, $n^2$ is either $0$ or $1$ modulo $3,$ we have to have one of $p^2,q^2,r^2$ be $1$ and the other two $0$ modulo $3.$ However, since $p,q,r$ are prime, $0\pmod 3$ implies they are equal to $3.$

If $p,q=3,$ the equation becomes $p^2+q^2+49r^2=18+49r^2=9k^2-101,$ or $9k^2-49r^2=(3k-7r)(3k+7r)=119=7\cdot 17.$ However, here, the difference of the two factors is a multiple of $7,$ which is impossible to do for $119,$ and hence this case is impossible.

If $q,r=3,$ the equation becomes $p^2+q^2+49r^2=p^2+450=9k^2-101,$ or, $9k^2-p^2=(3k-p)(3k+p)=551=19\cdot 29.$ Comparing factors, we get $(p,q,r,k)=(5,3,3,8).$

When $p,r=3,$ since the equation is symmetrical for $p$ and $q,$ we get the same solution as above, $(p,q,r,k)=(3,5,3,8).$

Thus, the only solutions are $(p,q,r,k)=(3,5,3,8),(5,3,3,8).$


Hint, due to Fermat's little theorem we van write:

$p^2 ≡p \mod(3)=3k_1 +p$

$q^2 ≡q \mod(3)=3k_2 + q$

$r^2 ≡r \mod (3)=3k_3 +r$

$$p^2+q^2+49r^2=3(k_1+k_2+49k_3)+p+q+49r$$

$$3(k_1+k_2+49k_3)+p+q+5+49r=9k^2-96 $$

Now we have to consider:

if $p$ or $q\equiv 0 \mod(3)$ , then:

$(q+5)$ or $(p+5)\equiv0 \mod(3)$

In both cases we must have:

$r\equiv0 \mod(3)$

Now you can find $p, q, r$ which satisfy the equation.