# Linear equation for a special domain and range

Consider a simple linear equation of the form:

$n=\frac{2x+2}{3}$

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)

Thanks!

-
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

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.
@Milosz: you can just write as you did and add "$x,n \in \mathbb N$". – lhf Feb 23 '11 at 17:19