Find all pairs of positive integers $(a, b)$ such that $\left|3^{a}-2^{b}\right|=1$
We perform a case disjunction.

First case: $3^{a}-2^{b}=1$. We then have: $-(-1)^{b} \equiv 1 \pmod{3}$, hence $b \equiv 1 \pmod{2}$. Thus, with $b=2c+1$, $3^{a}-2 \cdot 4^{c}=1$. If $c \geqslant 1$, then $3^{a} \equiv 1 \pmod{8}$, so $a=2d$. It follows: $3^{2d}-2^{2b+1}=1$. Thus: $\left(3^{d}-1\right)\left(3^{d}+1\right)=2^{2b+1}$. It follows that there exist $x, y$ such that $x+y=2b+1$ and $3^{d}-1=2^{x}$ and $3^{d}+1=2^{y}$. Therefore $2^{x}+2=2^{y}$. If $x \geqslant 2$, then $2^{y} \equiv 2 \pmod{4}$ but $2^{y} \geqslant 4$, which is absurd. Hence $x \in\{0,1\}$. A quick calculation leads to $x=1$ and $y=2$, it follows $b=1$ and $d=1$ so: $(a, b)=(2,3)$. Otherwise, $c=0$, and then, $3^{a}=3$, hence $a=1$. Therefore $(a, b)=(1,1)$ is another solution.

Second case: $2^{b}-3^{a}=1$. We then have, if $a \geqslant 1,(-1)^{b} \equiv 1 \pmod{3}$, so $b=2c$, thus, $2^{2c}-3^{a}=1$. Therefore $\left(2^{c}+1\right)\left(2^{c}-1\right)=3^{a}$. Therefore $2^{c}-1=3^{x}$ and $2^{c}+1=3^{y}$ with $x+y=a$. It follows, $3^{x}+2=3^{y}$. If $y \geqslant 1$, then $x=0$, so $y=1$. Otherwise, $y=0$, which is impossible. Therefore, we have $(a, b)=(1,2)$. In the last case, $a=0$, and thus, $b=1$ : we have another solution $(a, b)=(0,1)$