Example 5. Solve the equation in integers

$$
3^{x}-2^{y}=1
$$
A solution is. One solution is obvious: $(1 ; 1)$.

It is not difficult to notice that the equation cannot have negative and zero solutions. Therefore, we will look for solutions greater than 1.

Let's rewrite the equation in the following form: $2^{y}=3^{x}-1$.

Since $x \in \mathbf{N}$, the right side of the equation can be factored, and then we get:

$$
2^{y}=(3-1)\left(3^{x-1}+3^{x-2}+\ldots+3+1\right)
$$

or

$$
2^{y-1}=3^{x-1}+\ldots+3+1
$$

Since the left side of the equation is divisible by 2 (for $y>1$ and $y \in \mathbf{N}$), the sum on the right side must be divisible by 2. Each term in this sum is odd, so the number of terms must be even. Therefore, $x=2k$.

Using the formula for the sum of a geometric progression, we can rewrite the given equation as:

$$
2^{y}=3^{2k}-1
$$

or

$$
2^{y}=\left(3^{k}+1\right)\left(3^{k}-1\right)
$$

From this, it follows that $3^{k}+1$ and $3^{k}-1$ are powers of the number 2. But this can only be true when $k=1$. Indeed, if $3^{k}+1=2^{p}$ and $3^{k}-1=2^{q}$, then $p>q$ and $2 \cdot 3^{k}=2^{p}+2^{q}=2^{q} \times \left(2^{p-q}+1\right)$.

Since $2 \cdot 3^{k}$ is divisible only by the first power of the number 2, then $q=1$. From this, $3^{k}=1+2=3, k=1$. And we get another solution: $(2 ; 3)$.