0
$\begingroup$

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)$.

  • 1
    Given a, b, and c find x? Does there always have to be some x ?2017-01-03
  • 0
    What progress have you made so far?2017-01-03
  • 0
    What is $k$? Are $c$, $a$, and $b$ given?2017-01-03
  • 2
    @indjev99 Can you provide the original question2017-01-03
  • 0
    Are $a,b,c$ related, in particular is $\gcd(a,c)=1\,$?2017-01-03
  • 0
    @dxiv There is no information about how any two of the three constants are related.2017-01-03
  • 0
    @Harsh Kumar It is a system of 2 linear equations and 3 variables and I need to find its integer solutions. After playing with it for a while I got it reduced to a few instances of the problem described in my question. So after finding $x$ I plug into the other equation and so on. I can deal with all of that, but I'm just not sure how to solve this part.2017-01-03
  • 0
    @indjev99 Without any additional conditions on or knowledge about $a,b,c$ the problem is equivalent to solving the general linear congruence $ax+b \equiv 0 \pmod{c}$. See [this](https://proofwiki.org/wiki/Solution_of_Linear_Congruence) for example.2017-01-03
  • 0
    cn=ax+b so x=(cn-b)/a so cn =b mod a so n = c'b mod a assuming such a c' exist. Example if a=7 and b=4 and c=5 we have n=5'4 mod 7=3x4 mod 7 =5. So 25=7x+4 and x = 3 + 5k.2017-01-03
  • 0
    Well, no need to go much further. $x(k)=\frac{kc-b}{a}$ is what required, isn't it ?2017-01-03
  • 0
    @zwim $x$ needs to be whole number.2017-01-03

1 Answers 1

0

$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) $