Prime Numbers And Perfect Squares

5k Views Asked by At

Find all primes $p$ and $q$ such that $p^2 + 7pq + q^2$ is a perfect square.

One obvious solution is $p = q$ and under such a situation all primes $p$ and $q$ will satisfy.

Further if $p \neq q$ then we can assume without the loss of generality that $p > q$. Assuming this and that there exists at least one such perfect square I have tried to show some contradiction modulo $4$ as any odd perfect square leaves a remainder of $1$ when divided by $4$, but it is not working. However I firmly believe that $p = q$ is the only solution, but I have failed to prove this.

1

There are 1 best solutions below

2
On BEST ANSWER

Assume $p^2+7pq+q^2=n^2$ with $p\ge q$. Note that $p^2+2pq+p^2=(p+q)^2$, hence $$(n+p+q)(n-p-q)=n^2-(p+q)^2=5pq$$ We know the prime factorization of $5pq$ and that $n-p-q<n+p+q$, hence conclude that $n-p-q$ is $\in\{1,5,q,p\text{ (if $5q>p$)},5q\text{ (if $5q<p$)}\}$. Inverstigate these cases one by one.