Ta có:[tex]p^2+3pq+q^2=(p^2+2pq+q^2)+pq=(p+q)^2+pq=a^2(a\in \mathbb{N})\Rightarrow a^2-(p+1)^2=pq\Rightarrow (a-p-q)(a+p+q)=pq[/tex]
Vì [tex]a-p-qp;a+p+q>q\Rightarrow \left\{\begin{matrix} a+p+q=pq\\ a-p-q=1 \end{matrix}\right.\Rightarrow 2(p+q)=pq-1\Rightarrow pq-2(p+q)+4=5\Rightarrow (p-2)(q-2)=5\Rightarrow p=3,q=7 hoặc p=7,q=3[/tex]