Determine all pairs of prime numbers $(p, q)$ such that $p^2 + 5pq + 4q^2$ is a square of an integer.
Problem
Source: 2019 Grand Duchy of Lithuania, Mathematical Contest p4 (Baltic Way TST)
Tags: number theory, Perfect Square
04.10.2020 16:36
Given: $$p^2 + 5pq + 4q^2=a^2$$$q \mid (a+p)(a-p)$, thus $a=qk-p$ or $a=qk+p$. Case a. $$p^2 + 5pq + 4q^2=(qk-p)^2$$$$p^2 + 5pq + 4q^2=q^2k^2 -2qpk+p^2\implies q(k-2)(k+2)=p(2k+5)$$Thus, $p=q$ or $p \mid k-2$ or $p \mid k+2$. Case 1. $p=q$ means that $a^2=10p^2$, which cannot be true. Case 2. $p \mid k-2$ means that $k+2 \mid 2k+5$, which furthermore gives that $k+2 \mid 1\implies k=-1 \text{ or } k=-3$. Subcase 2.1. $k=-1$ means that $p=3$, hence $q\cdot (-3)\cdot 1=3\cdot 3 \implies q=-3$, no solution. Subcase 2.2. $k=-3$ means that $p=5$, hence $q\cdot (-5)\cdot (-1)=5\cdot (-1) \implies q=-3$, no solution. Case 3. $p \mid k+2$ means that $k-2 \mid 2k+5$, which furthermore gives that $k-2 \mid 9\implies k=11, k=5, k=3, k=1, k=-1 \text{ or } k=-7$. Subcase 3.1. $k=-7$, means that $p=5$, this means that $q$ is negative, no solution. Subcase 3.2. $k=-1$, means that $p=1$, no solution. Subcase 3.3. $k=1$ means that $p=3$, thus $q\cdot (-1)\cdot 3=3\cdot 7\implies $ $q$ is negative, no solution. Subcase 3.4. $k=3$, means that $p=5$, which means that $q=\frac{5\cdot 11}{5}=11$. SOL Subcase 3.5. $k=5$ means that $p=7$, which means that $q=\frac{7\cdot 15}{3 \cdot 7}=5$. SOL Subcase 3.6. $k=11$ means that $p=13$, which means that $q=\frac{13\cdot 27}{9 \cdot 13}=3$. SOL Case b. $$p^2 + 5pq + 4q^2=(qk+p)^2$$$$p^2 + 5pq + 4q^2=q^2k^2 +2qpk+p^2\implies q(k-2)(k+2)=p(5-2k)$$Thus, $p=q$ or $p \mid k-2$ or $p \mid k+2$. Case 1. $p=q$ means that $a^2=10p^2$, which cannot be true. Case 2. $p \mid k-2$ means that $k+2 \mid 5-2k$, which furthermore gives that $k+2 \mid 9\implies k=7, k=1, k=-1, k=-3, k=-5 \text{ or } k=-11$. Subcase 2.1. $k=-11$ means that $p=13$, hence $q=\frac{13\cdot 27}{(-9) \cdot (-13)}=3$. SOL Subcase 2.2. $k=-5$ means that $p=7$, hence $q=\frac{7\cdot 15}{(-3) \cdot (-7)}=5$. SOL Subcase 2.3. $k=-3$ means that $p=5$, hence $q=\frac{5\cdot 11}{(-5) \cdot (-1)}=11$. SOL Subcase 2.4. $k=-1$ means that $p=3$, hence $q$ is negative, no solution. Subcase 2.5. $k=1$ means that $p=1$, no solution. Subcase 2.6. $k=7$ means that $p=5$, hence $q$ is negative, no solution. Case 3. $p \mid k+2$ means that $k-2 \mid 5-2k$, which furthermore gives that $k-2 \mid 1\implies k=1 \text{ or } k=3$. Subcase 3.1. $k=1$ means that $p=3$, hence $q$ is negative, no solution. Subcase 3.2. $k=3$ means that $p=5$, hence $q$ is negative, no solution. Checking solutions, we confirm that those indeed work. Answer. $\boxed{(p,q)=(5,11); (p,q)=(7,5) \text{ and } (p,q)=(13,3)}$.