Prove that if $a$ divides $ b$ , and $a$ divides $b + 2$ then $a = 1$ or $ a = 2$.

1.5k Views Asked by At

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$.

4

There are 4 best solutions below

2
On BEST ANSWER

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$?

1
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$$

0
On

$$a\vert b \text{ and }a \vert c \implies a \vert (c-b)$$

0
On

We have $a\mid b+2 \Rightarrow b+2 = ka$. also $a\mid b \Rightarrow b = la \Rightarrow la + 2 = ka \Rightarrow 2 = (k-l)a \Rightarrow a\mid 2 \Rightarrow a = 1, 2.$