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

Given two integers $a,b$, how to prove that for every integer $z$, there exist integers $x,y$ such that $z=ay+bx+xy$

And how does one in general prove or disprove that a formula in one or more variables takes on every integer?

share|cite|improve this question
Do you want to prove this for particular values of $a$,$b$,$m$? It's clearly not true for arbitrary values, since $z$ is divisible by $\gcd(a,b,m)$. – joriki Oct 7 '11 at 12:24
Try $y=1-b$ and $x=z+ab-a$. – Did Oct 7 '11 at 13:14
I find this quite unacceptable. You posted a question; I pointed out that the assertion it contained was false; we engaged in a long exchange of comments, during which you kept changing and deleting your comments, forcing me to do the same; you made several confusing errors in your comments which I patiently pointed out to you; and when we had finally succeeded in clarifying your question, I wrote an answer answering it correctly. Your reaction to all this effort on my part is to change the question without marking it as changed and downvoting my correct answer to the original question?! – joriki Oct 7 '11 at 14:13
up vote 5 down vote accepted

The question has changed. We answer the changed question, which asks us to prove that for any integers $a$, $b$, and $z$ the equation $z=ay+bx+xy$ has a solution in integers $x$ and $y$.

Note that $ay+bx+xy=(x+a)(y+b)-ab$. Thus the equation $z=ay+bx+xy$ is equivalent to $(x+a)(y+b)=z+ab$. This equation is simple to solve. Indeed, it is not hard to describe all solutions.

If $z+ab=0$, the solutions are $x=-a$, $y$ anything, and $y=-b$, $x$ anything. If $z+ab \ne 0$, express $z+ab$ in any way as a product $uv$, where $u$ and $v$ are integers, not necessarily positive. Then $x=u-a$, $y=v-b$ is a solution of the original equation, and all solutions can be obtained in this way. In particular, if we know the prime power factorization of $z+ab$, we can find an explicit expression for the number of solutions.

share|cite|improve this answer

The statement is false, since $z$ is necessarily divisible by $\gcd(a,b,m)$, which may not be $1$. Thus the equivalent statement in the comment is likewise false. For instance, the set of products of two numbers with remainder $2$ modulo $4$ only contains odd multiples of $4$.

share|cite|improve this answer
Please see my comment under the question. – joriki Oct 7 '11 at 14:14
There have been two further downvotes. Could the downvoters please explain their downvotes? Please see the FAQ: "If you see misinformation, vote it down. Add comments indicating what, specifically, is wrong." Also, please note that this is an answer to a previous version of the question, as explained in my comment under the question. You can see the previous versions of the question by clicking on the link "edited ..." underneath the question. – joriki Oct 9 '11 at 9:07

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.