Example 7 Find all positive integer pairs $(m, n)$ that satisfy the equation
$$3^{m}=2 n^{2}+1$$
It is easy to verify that $(m, n)=(1,1),(2,2)$ and $(5,11)$ satisfy (19). Below, we prove that these pairs are all the solutions that meet the conditions.

Case 1: $m$ is even. In this case, the problem turns into finding the positive integer solutions of the Pell equation
$$x^{2}-2 y^{2}=1$$

that make $x$ a power of 3.
Since the fundamental solution of (20) is $\left(x_{0}, y_{0}\right)=(3,2)$, all positive integer solutions $\left(x_{k}, y_{k}\right)$ are given by
$$x_{k}+y_{k} \sqrt{2}=(3+2 \sqrt{2})^{k}, k \in \mathbf{N}^{*}$$

Thus,
$$x_{k}-y_{k} \sqrt{2}=(3-2 \sqrt{2})^{k},$$

solving for
$$x_{k}=\frac{1}{2}\left((3+2 \sqrt{2})^{k}+(3-2 \sqrt{2})^{k}\right)$$

Using the binomial theorem, for any $t \in \mathbf{N}^{*}$, we have
$$x_{2 t}=3^{2 t}+\mathrm{C}_{2 t}^{2} \cdot 3^{2 t-2} \cdot 8+\cdots+\mathrm{C}_{2 t}^{2 t-2} \cdot 3^{2} \cdot 8^{t-1}+8^{t}$$

which is not a multiple of 3, and thus cannot be a power of 3.
$$\begin{aligned}
x_{2 t+1}= & 3^{2 t+1}+\mathrm{C}_{2 t+1}^{2} \cdot 3^{2 t-1} \cdot 8+\cdots+\mathrm{C}_{2 t+1}^{2 t-2} \cdot 3^{3} \cdot 8^{t-1} \\
& +\mathrm{C}_{2 t+1}^{2 t} \cdot 3 \cdot 8^{t} \\
= & \mathrm{C}_{2 t+1}^{1} \cdot 3 \cdot 8^{t}+\mathrm{C}_{2 t+1}^{3} \cdot 3^{3} \cdot 8^{t-1}+\cdots+\mathrm{C}_{2 t+1}^{2 t+1} \cdot 3^{2 t+1}
\end{aligned}$$

Now, consider the term in (21)
$$T_{l}=\mathrm{C}_{2 t+1}^{2 l+1} \cdot 3^{2 l+1} \cdot 8^{t-t}$$

in the prime factorization of 3. Let $v_{3}(2 t+1)=\alpha$. For $1 \leqslant l \leqslant t$, we have
$$v_{3}((2 l+1)!)=\sum_{i=1}^{+\infty}\left[\frac{2 l+1}{3^{i}}\right] \leqslant \sum_{i=1}^{+\infty} \frac{2 l+1}{3^{i}}=\frac{1}{2}(2 l+1)<l$$

Thus,
$$v_{3}\left(T_{l}\right) \geqslant \alpha+(2 l+1)-l=\alpha+l+1 \geqslant \alpha+2,$$

while $v_{3}\left(T_{0}\right)=\alpha+1$. This indicates that in the right-hand side of (21), the prime factorization of 3 in all terms except the first is at least $\alpha+2$. Hence, $3^{a+1} \mid x_{2 t+1}$, but $3^{a+2} \nmid x_{2 t+1}$.

Therefore, when $m$ is even, there is only one solution $(m, n)=(2,2)$.
Case 2: $m$ is odd. In this case, the problem turns into finding the solutions of the Pell equation
$$3 x^{2}-2 y^{2}=1$$

that make $x$ a power of 3.
Multiplying both sides of (22) by 3, we can transform the problem into finding the solutions of the Pell equation
$$x^{2}-6 y^{2}=3$$

that make $x$ a power of 3.
Using a similar approach as in Example 4, we can find all positive integer solutions $\left(x_{k}, y_{k}\right)$ of (23), which are determined by
$$x_{k}+y_{k} \sqrt{6}=(3+\sqrt{6})(5+2 \sqrt{6})^{k-1}, k \in \mathbf{N}^{*}$$

Thus, we have
$$x_{k}=\frac{1}{2}\left((3+\sqrt{6})(5+2 \sqrt{6})^{k-1}+(3-\sqrt{6})(5-2 \sqrt{6})^{k-1}\right) .$$

Using $5 \pm 2 \sqrt{6}=\frac{1}{3}(3 \pm \sqrt{6})^{2}$, we get
$$x_{k}=\frac{1}{2 \cdot 3^{2(k-1)}}\left((3+\sqrt{6})^{2 k-1}+(3-\sqrt{6})^{2 k-1}\right)$$

Now, we need to find all positive integers $k$ such that
$$A_{k}=\frac{1}{2}\left((3+\sqrt{6})^{2 k-1}+(3-\sqrt{6})^{2 k-1}\right)$$

is a power of 3.
Notice that,
$$\begin{aligned}
A_{k} & =3^{2 k-1}+\mathrm{C}_{2 k-1}^{2} \cdot 3^{2 k-3} \cdot 6+\cdots+\mathrm{C}_{2 k-1}^{2 k-2} \cdot 3 \cdot 6^{k-1} \\
& =3^{2 k-1}+\mathrm{C}_{2 k-1}^{2} \cdot 3^{2 k-2} \cdot 2+\cdots+\mathrm{C}_{2 k-1}^{2 k-1} \cdot 3^{k} \cdot 2^{k-1} \\
& =\mathrm{C}_{2 k-1}^{1} \cdot 3^{k} \cdot 2^{k-1}+\mathrm{C}_{2 k-1}^{3} \cdot 3^{k-1} \cdot 2^{k-2}+\cdots+\mathrm{C}_{2 k-1}^{2 k-1} \cdot 3^{2 k-1}
\end{aligned}$$

Using a similar analysis method for the right-hand side of (24) as for (21), and classifying based on $3 \mid(2 k-1)$ and $3 \nmid (2 k-1)$, we can show that for $k \geqslant 3$, $A_{k}$ is not a power of 3 (the detailed process is left to the reader). Therefore, $k=1$ or 2, corresponding to $(m, n)=(1,1)$ and $(5,11)$.