When will $ax+1$ be divisible by $b$?

170 Views Asked by At

Consider two natural numbers $a$ and $b$ such that $b$ is prime and $a$ is indivisible by $b$. Then, for which integral values of $x$ should $ax+1$ be divisible by $b$ ? I tried different values of $a$ and $b$ and found the values of $x$ satisfing the above condition in each case, but saw no pattern. Please give me the answer of this question with proper explanation if possible because I am trying to prove something and this is a crucial part of that proof.

2

There are 2 best solutions below

2
On BEST ANSWER

I found the answer using Fermat's Little Theorem. The answer should be $x=b*n-a^{b-2}$ where $n$ is an integer.

8
On

We wish to solve $ax\equiv -1 \pmod b$ for $x$ with $a$ and $b$ given and coprime, and $b$ prime. This is simply the negative of the multiplicative inverse of $a$ in $\mathbb Z_b$, which can be computed by a variety of methods for any given $a$ and $b$, since $a$ and $b$ are coprime. Once this value, let us say $-a^{-1}$, is found, the integral solutions for $x$ are $x\equiv -a^{-1} \pmod b$, or $x=-a^{-1}+bn$ for any integer $n$.