For positive integers $a,b$, prove that if $a$ divides $b$ and $a$ divides $b + 2$ then $a = 1$ or $a = 2$.
I know that if $a|b$ and $a|c$ then $a|b+c$ or $a|b-c$ but I can't figure out how to get $a=1$ or $a=2$.
For positive integers $a,b$, prove that if $a$ divides $b$ and $a$ divides $b + 2$ then $a = 1$ or $a = 2$.
I know that if $a|b$ and $a|c$ then $a|b+c$ or $a|b-c$ but I can't figure out how to get $a=1$ or $a=2$.
On
Hint1: $(a \mid b) \Longrightarrow \left(a \mid (b+ka) \wedge k \in \mathbb{Z}\right)$
Hint2:$\left(a \mid b \wedge a \mid (b+2)\right) \Longrightarrow \left(\exists k \in \mathbb{Z}\right)(b+2 = b + ka)$
$$b + 2= b + ka \Longleftrightarrow 2 = ka \Leftrightarrow \frac{2}{a} = k \in \mathbb{Z} \Longrightarrow a \mid 2$$
You "know that if $a|b$ and $a|c$ then $a|b-c$".
So if $a|b+2$ and $a|b$ then $a|(b+2)-b$, i.e. $a|2$.
What divides $2$?