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

I am in high school right now and I would like to learn how to approach this sort of problems. I think this is called a diophantine eqution. Thanks a bunch

This is what I deduces, just so you know the work done (though I doubt its useful)

$x|x(x-1)+y(y-1) \rightarrow x|y(y-1)$

$y|x(x-1)+y(y-1) \rightarrow y|x(x-1)$

share|cite|improve this question
up vote 7 down vote accepted


On rearrangement, $$x^2-x(1+y)+y^2-y=0$$ which is a Quadratic equation in $x$

The discriminant is $(1+y)^2-4(y^2-y)=1-3y^2+6y=4-3(y-1)^2$

For real $x, 4-3(y-1)^2\ge0\implies (y-1)^2\le\frac43\implies -\frac2{\sqrt3}\le y-1\le \frac2{\sqrt3}$

As $\frac2{\sqrt3}<2, -2<y-1<2\iff-1<y<3$

As $y$ is integer, $0\le y\le2$

Test for each value

share|cite|improve this answer

First note that $2|xy|\le x^2+y^2$, then by the equation we must have $|x|+|y|\ge \frac{1}{2}(x^2+y^2)$, which imply that $(x\pm 1)^2+(y\pm1)^2\le2$. The only thing left is to check which $(x,y)$ satisfying this condition.

share|cite|improve this answer
why $|x|+|y| \geq \frac{1}{2}(x^2+y^2)$ – Carry on Smiling Aug 3 '13 at 16:19
@Omnitic $|x|+|y|\ge x+y=x^2+y^2-xy\ge\frac{1}{2}(x^2+y^2)$ – asatzhh Aug 3 '13 at 16:26

This particular curve is an ellipse, which you can see by plugging into wolfram alpha or by expressing it in standard form, which is $x^2-xy+y^2-x-y=0$ and considering the discriminant, which in this case is $-3$.

This particular ellipse has integer solutions $(0,0)$, $(1,0)$, $(0,1)$, $(1,2)$, $(2,1)$, $(2,2)$ which can be found by inspection. There are no more because the ellipse is only so big.

share|cite|improve this answer
How does inspection work? – Carry on Smiling Aug 3 '13 at 16:10
Inspection works by trying all values of $x,y$ between $-1$ and $3$, say. If you look at the plot on wolfram alpha you'll see the ellipse isn't so big. – vadim123 Aug 3 '13 at 16:11
Is there an algebraic way to approach this other than using computing power to plot the equation? – Carry on Smiling Aug 3 '13 at 16:12
There are ways to plot conic sections by hand, which you ought to be learning in high school. The methods are a bit tedious if there's an $xy$ term, such as here. – vadim123 Aug 3 '13 at 16:13
you missed (2,2) – Carry on Smiling Aug 6 '13 at 19:03

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.