<s>[INST] Given positive integers $ x , y$ and that $3x^2 + x = 4y^2 +y$ Prove that $x-y$ is a perfect square This is some old Olympiad problem (I vaguely remember its Iranian )
I factorised it as
$ (x-y)(3x + 3y +1) = y^2 $
Then I fruitlessly tried to prove 
$\gcd(x-y, 3x + 3y +1 ) = \gcd (6x+1,6y+1) = 1$
for proving that $x-y$ is a perfect square.
How do I continue my method or are there other ways to approach this intuitively?
 [/INST] Here is the method to approach this sort of problem. Note that $x>y$. Let $\gcd(x,y)=d$.  Now, first note that $$x-y=4y^2-3x^2 \equiv 0 \pmod{d^2} \tag{1}$$
Now, $$4y^2-3x^2=4(y-x)(y+x)+x^2 \equiv 0 \pmod {x-y} $$
And $$4y^2-3x^2=3(y-x)(y+x)+y^2 \equiv 0 \pmod {x-y} $$
This gives us that $x-y$ is a common factor of $x^2$ and $y^2$, so it must divide their greatest common divisor, $d^2$. So we have $$d^2 \equiv 0 \pmod{x-y}$$ 
So $d^2$ and $x-y$ both divide each other. Since $x>y$, we have that $x-y=d^2$. Our proof is done. 
</s>