Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|cite|improve this question
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
up vote 7 down vote accepted

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$.

[Adding fix noted in comments.]

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$.

share|cite|improve this answer
Ah, yes, of course. – Thomas Andrews Jan 5 '12 at 18:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.