I have to solve the following equation: $(x-y)^2=x+y$, where $x$ and $y$ are non-negative integers. This equation has an infinite number of solutions, but how to prove that there exists a positive integer k such that $x=\frac{(k+1)(k+2)}{2}$ and $y=\frac{k(k+1)}{2}$? Thanks!
-
Have you tried solving $(\frac{(k+1)(k+2)}{2} - \frac{k(k+1)}{2})^2 = \frac{(k+1)(k+2)}{2} + \frac{k(k+1)}{2}$? – Keba Feb 25 '14 at 15:17
4 Answers
Hint: Rewrite as $(x-y)^2=(x-y)+2y$. Set $k+1=x-y$. Our equation is then $k(k+1)=2y$.

- 507,029
Just substitute the values for x and y in the right hand side, you get:
$$\left(\frac{(k+1)(k+2)}{2}-\frac{k(k+1)}{2}\right)^2 = \left(\frac{(k+1)(k+2-k)}{2}\right)^2 = (k+1)^2$$
If you do the same thing on the left side, you get $(k+1)^2$ too, Q.E.D

- 450
On rearranegment we have $$x^2-x(2y+1)+y^2-y=0$$
$$\implies x=\frac{2y+1\pm\sqrt{(2y+1)^2-4(y^2-y)}}2=\frac{2y+1\pm\sqrt{8y+1}}2$$
As $x$ has to be integer, we need $8y+1$ to be perfect square
As $y$ is also an integer, $8y+1$ is odd, hence can be written as $(2a+1)^2$ where $a$ is any integer
Now simplify and find $x,y$ is terms of $a$

- 274,582
Probably it is necessary to draw a formula for the solution in the general form:
In the equation: $(x-y)^2=x+y$
Solutions can be written:
$x=\frac{a(a+1)}{2}+\frac{b(b-1)}{2}-ab$
$y=\frac{a(a-1)}{2}+\frac{b(b+1)}{2}-ab$
$a,b$ - what some integers.

- 4,301