<s>[INST] When $f(x) = \frac{ax + b}{a -x + 1}$ is an integer Given that $a$ and $b$ are positive integers. and $$f(x) = \frac{ax + b}{a -x + 1}$$ is an integer, what integer values can x have?
If I could only somehow move $x$ from numerator to the denominator I would be able to solve this by factoring the numerator.
 [/INST] Since 
$$a-x+1\mid ax+b \;\;\;{\rm and} \;\;\;a-x+1\mid a(a-x+1)$$ 
we have $$a-x+1\mid (ax+b)+(a^2-ax+a)= a^2+a+b$$
So $x=a-d+1$ where $d$ divides $a^2+a+b$.
</s>