# How many pairs of natural solutions to $p^2q^2-4(p+q)=a^2$?

How shall I find all natural numbers p and q such that $$p^2q^2-4(p+q)=a^2$$ for some natural number $a$? Thanks!

-
Please don't phrase your posts as if you were assigning homework to us. Thank you. – Arturo Magidin Jan 5 '12 at 17:37
I rephrased your post and hope it could be more appealing. – Tim Jan 5 '12 at 17:41
You should let the OP rephrase it so they can learn from their mistakes. – Graphth Jan 5 '12 at 17:49
For $0\le p \le q \le 10^5$, the only solutions are $(0,0)$, $(1,5)$, $(2,2)$, $(2,3)$. – lhf Jan 5 '12 at 18:10

Rewrite as $(pq-a)(pq+a)=4(p+q)$. This means that $pq+a\leq 4(p+q)$, or $(p-4)(q-4) + a \leq 16$.

For $p,q\geq 4$, there can only be finitely many such triples.

So you need to only check when at least one of $p,q<4$.

Case $q=0$ is easy.

When $q=1$, the equation becomes $p^2 - 4(p+1) = a^2$. But $p^2-4(p+1)=(p-2)^2 - 8$, so we need: $(p-2-a)(p-2+a) = 8$.

$q=2$ means $4p^2-4(p+2) = (2p-1)^2 - 9 = a^2$, or $(2p-1-a)(2p-1+a)=9$.

$q=3$, then $9p^2-4(p+3) = (3p-1)^2 + (2p-13)$, so $2p-13\leq 0$ which is only true for finitely many $p$.

-
Ah, yes, of course. – Thomas Andrews Jan 5 '12 at 18:31