-2

I am looking for other solution of a problem, which I named:
$$\text{Simple hit problem}$$

Let:
$$y = \frac{a x + b}{c}$$ $$a, b, c, x \in \Bbb{Z}$$ For which $a, b, c$ there exists $x$ for such $y \in \Bbb{Z}$ ?


I noticed that the solution exists for $a, b, c$, if:
$$(ax) \ \text{mod} \ c = c - (b \ \text{mod} \ c),$$ but the approach relies on checking all unique values of result of modulo operator from left side of equation.


The question is, if there exists any better approach for this problem or anyway it come down to check, if some equation will be true for some $x \in A$, where A will be a set of finite ammount of values ?

Bill Dubuque
  • 272,048
Michal
  • 271
  • @BillDubuque Are you sure about your interpretation of the query? See my answer which raises this issue. Although I am tempted to vote to re-open here, I would like your opinion first. – user2661923 Feb 08 '21 at 21:29
  • 1
    @user2661923 Even with that interpretation it is still a special case of the linked general case. – Bill Dubuque Feb 08 '21 at 21:35

2 Answers2

-1

We can rewrite the equation as $ax+b=yc$, or by renaming $a$ with $-a$ to the Diophantine equation $ax+cy=b$. This has been solved here and is a standard question:

Diophantine equation $ax + by = c$ has an integer solution $x_0, y_0$ if and only if $\gcd(a,b)|c$

Dietrich Burde
  • 130,978
-1

Let:
$$y = \frac{a x + b}{c}$$ $$a, b, c, x \in \Bbb{Z}$$ For which $a, b, c$ there exists $x$ for such $y \in \Bbb{Z}$ ?

Question seems ambiguous to me. As other responses have done, a reasonable assumption is that $x$ must be an integer.

However, the other responses seemed to have interpreted the equation as that $x$ and $y$ may vary. The alternative interpretation is that you are given some fixed integer $y$, and are asking for which values of $a,b,c$ can a solution involving an integer value of $x$ be produced.

Under this alternative interpretation of the problem, which (admittedly) the OP may not have intended, since

$cy = ax + b$,
the constraints on $a,b,c$ for the fixed value of $y$ are that
$c \neq 0$ and
$a|(cy - b)$.

Here, if $b,c$ are chosen so that $(cy - b) = 0$, then $a$ must equal $0$, and $x$ can be anything.

Alternatively, if $b,c$ are chosen so that $(cy - b) \neq 0$, then $a$ can not equal $0$.

user2661923
  • 35,619
  • 3
  • 17
  • 39