# Given that $c$ divides $ax+b$ find all integer solutions for $x$

So I had a more complicated problem and managed to reduce it to something of the the form: $c|({ax+b})$ where $x$ is an integer. I need to express $x$ as a function of some parameter $k$.

$a, b$ and $c$ are constants. I have to find all integer solutions for $x$ and express them as some function with one parameter. So I should get a function $x(k)$.

• Given a, b, and c find x? Does there always have to be some x ? Jan 3, 2017 at 3:28
• What progress have you made so far? Jan 3, 2017 at 3:31
• What is $k$? Are $c$, $a$, and $b$ given? Jan 3, 2017 at 3:32
• @indjev99 Can you provide the original question Jan 3, 2017 at 3:37
• Are $a,b,c$ related, in particular is $\gcd(a,c)=1\,$?
– dxiv
Jan 3, 2017 at 3:40

$c|ax+b$ has integer solutions if $\gcd (a,c)=1$ or $b$ is a multiple of $\gcd (a,c)$. Otherwise there is no solution.
If $\gcd (a,c)=1$ then we can solve $na+mc=1$.
Then $x=-nb+kc$ is an integer solution.
As $ax+b= -anb-akc+b=(mc- 1)b+akc+b=c (mb+ak)$
If $\gcd (a,c) \ne 1$ but $b$ is a multiple of $\gcd (a,c)$ then solve for $c/\gcd (a,c)$ divides $(ax+b)/\gcd (a,c)$