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

Consider a simple linear equation of the form:


Let $n$ and $x$ represent something that comes in whole positive quantities (for example physical objects).

How can I

  1. Define the equation only for $n$ and $x$ that are a part of natural numbers (whole numbers $>0$)
  2. Solve the equation satisfying the above restriction (without for instace graphing it and looking for $n$ and $x$ that work)


share|cite|improve this question
Have you tried noticing that $2x + 2$ has to be divisible by 3? What choices of $x$ have that property? If $x$ is natural, then certainly $x = \{2, 5, 8, 11, \cdots \}$ all work. What pattern is going on here? – Joshua Shane Liberman Feb 23 '11 at 12:50
@Joshua I derived this equation from my work on error correcting codes. If every 2nd bit is flipped in codewords of length 3, then codewords number $n$ will have their first bit flipped, hence also flipping their last bit resulting in two bits being flipped in that particular codeword. Does it make sense? – Milosz Wielondek Feb 23 '11 at 13:00
up vote 0 down vote accepted

If you want only integer solutions, then you have a Diophantine problem. Your equation can be written $3n=2x+2$, from which you deduce that $n$ is even. From there, it's easy to find all integer solutions. You can then select the positive ones, if any.

share|cite|improve this answer
Thanks for the link! But let's say I don't want to solve the equation but simply post it in a paper - how do I define it as a diophantine equation in a concise manner? – Milosz Wielondek Feb 23 '11 at 13:17
@Milosz: you can just write as you did and add "$x,n \in \mathbb N$". – lhf Feb 23 '11 at 17:19

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.