1

I was wondering if someone could give me some more intuition on why we need that $\gcd(a,n)$ divides $b$ when we want to solve $ax\equiv b\pmod{n}$?

egreg
  • 238,574

3 Answers3

2

Hint $ $ If solvable then $\ ax+cn = b\ $ so $\,d\mid a,n\,\Rightarrow\, d\mid b,\,$ i.e. a common divisor $\,d\,$ of $\,a,n\,$ must divide $\,b\,$ if a solution $\,x\,$ exists.

Bill Dubuque
  • 272,048
0

If $d\mid n$ there are well-defined projection maps $x\bmod n\mapsto x\bmod d$. If $ax\equiv b$ mod $n$ and we reduce the equation mod $g:=\gcd(a,d)$, the equation becomes $0\equiv b\bmod g$, i.e. $g\mid b$.

anon
  • 151,657
0

This congruence is solvable if there exists an integer $y$ such that $b=ax+ny$. Now the ideal $(a, n)$, by definition, is generated by $\gcd(a,n)$.

Bernard
  • 175,478