When does $c\mid a(n+x)+b+1$, if we know that $c\mid an+b$?

68 Views Asked by At

If $an+b$ is divisible by $c$. Then for which values of $x$ will $a(n+x)+b+1$ be divisible by $c$?
$a$, $b$, $c$, $n$, $x$ are all non-negative integers.

1

There are 1 best solutions below

4
On BEST ANSWER

As suggested in the comments, if $c\mid an+b$, then $$c\mid a(n+x)+b+1 $$$$\iff c\mid a(n+x)+b+1-an-b=ax+1$$

$$\iff ax\equiv -1\pmod{\! c}$$

If $(a,c)=d>1$, then $d\mid -1$, impossible.

So necessarily $(a,c)=1$. It turns out it is sufficient for $x$ to exist.

$a^{-1}$ exists mod $c$, so $ax\equiv -1\iff x\equiv -a^{-1}\pmod{\! c}$.

Expressed without modular arithmetic, we have $$c\mid ax+1\iff a(-x)+ck=1$$

for some integer $k\in\Bbb Z$.

Such integer pair $(-x,k)$ exists iff $(a,c)=1$ by Bezout's lemma.