# Proving there is no solutions in diophantine equations

I recently saw a question that I couldn´t answer, so I decided to do a little C code to test if some solutions were possible but I got nothing. The problem is:

If $m,n, p \in \mathbb{Z}^+$ give the number of solutions of $$4mn-m-n=p^2$$ I couldn't find any answer up to $100$ for $m$ or $n$, and it really surprises me that an equation with so many degrees of freedom apparently doesnt have solutions. Any help is greatly appreciated.

• m=n=p=0 is a solution – Emanuele Paolini Jul 2 '13 at 21:25
• It includes only positive integers – chubakueno Jul 2 '13 at 21:30

Multiplying your equation by four and regrouping allows us to rewrite it in the form $$(4m-1)(4n-1)=4p^2+1.$$ Let $q$ be any prime factor of r.h.s. Clearly $q$ is odd. As $$(2p)^2=4p^2\equiv-1\pmod{q},$$ we see that $-1$ is a quadratic residue modulo $q$. For odd primes this is known to imply that $q\equiv1\pmod4$. But the left hand side manifestly also has prime divisors congruent to $-1\pmod4$. Both $4n-1$ and $4m-1$ must have at least one such prime factor. This is a contradiction. Therefore there are no solutions with $m,n,p$ positive.
• The two facst at play are: 1) all prime divisors of $x^2+1$ are congruent to $1$ mod $4$, and 2) some prime divisor of a number congruent to $-1$ mod $4$ is also congruent to $-1$ mod $4$ themselves. – Jyrki Lahtonen Jul 2 '13 at 21:38
• if $x=7$, then $7^2+1=50=2*5^2$, but $2$ is not congruent to $1\mod 4$, can you please explain this? – chubakueno Jul 2 '13 at 22:20
• Oops. The even prime is an exception for $x^2+1$ as everything is a quadratic residue mod two. In your question I was looking at factors $4p^2+1$, so $2$ could obviously be ruled out as a factor. I forgot to mention this possibility in the comment. A genuine mistake/omission anyway. Well spotted! – Jyrki Lahtonen Jul 3 '13 at 5:40