# Prove $m-n$ and $2m+2n+1$ are coprime

I have a small problem:

Let $m$ and $n$ be integers such that $2m^2+m = 3n^2+n$. Prove that $m-n$ and $2m+2n + 1$ are perfect square.

My work:

We have $$(m-n)(2m+2n+1) = 2(m^2-n^2) + m-n = n^2.$$

So, we need to prove that $m-n$ and $2m+2n+1$ are coprime. But I don't get further. Anyone can give me a hint?

• @S.Panja-1729 No, read the whole question. He wants to prove they're coprime, since that is the only thing he needs to finish the problem. – user236182 Sep 4 '15 at 16:39
• @S.Panja-1729 It's enough to prove they're coprime to prove they're perfect squares. – user236182 Sep 4 '15 at 16:40
• Ok...He should add that statement , but he should write the actual question.. – Empty Sep 4 '15 at 16:42
• @S.Panja-1729 He made his question clear at the end. – user236182 Sep 4 '15 at 16:43
• – Will Jagy Sep 4 '15 at 17:25

Assume for contradiction $p\mid \gcd(m-n,2m+2n+1)$ for some prime $p$.
But then $p\mid n^2\iff p\mid n$, and so $p\mid m-n\implies p\mid m$.
However, $p\mid 2m+2n+1$ is then impossible.