5

Here we assume $(a,b) = 1$ and $a^{-1}$ and $b^{-1}$ are canonical (e.g. $0 < a^{-1} < b)$.

Counter example or proof are appreciated!

Bill Dubuque
  • 272,048
Wei Hu
  • 113

2 Answers2

3

Hint. Let $x=a(a^{-1} \bmod b) + b(b^{-1} \bmod a) $. Then $x\equiv 1\pmod{ab}$ and $x<2ab$.

1

HINT: If you use the Euclidean algorithm, you get integers $m,n$ with $ma+nb=1$. One will be positive, one will be negative. Without loss of generality, take $m<0<n$. Then how do you get your canonical $a^{-1}$ from $m$ and your canonical $b^{-1}$ from $n$?

By the way, now that you're done, it seems that the answer will always be $ab+1$. That follows from both suggested proofs.

Ted Shifrin
  • 115,160