A single counterexample suffices: with \( a=2 \), \( b=2 \), \( x=2 \), \( y=0 \) we get \( ax+by=4 \), which is divisible by 4, yet 4 does not divide 2. The converse direction does hold: common divisors of \( a \) and \( b \) divide \( ax+by \).
Bézout's identity states that, for integers \( a \) and \( b \) not both zero, there exist integers \( x \) and \( y \) such that \( ax+by=\gcd(a,b) \).
\[ax+by=\gcd(a,b) \text{ for some } x,y\in\mathbb{Z}\]