12. find all integers $m, n \geq 2$ that fulfill the following two conditions:

(i) $m+1$ is a prime number of the form $4 k+3$ for an integer $k$.

(ii) There exists a prime number $p$ and a non-negative integer $a$ with

$$
\frac{m^{2^{n}-1}-1}{m-1}=m^{n}+p^{a}
$$
Solution According to the prerequisite, $m \equiv 2$ (4). Rewrite the equation to

$$
m^{2^{n}-1}-1=(m-1)\left(m^{n}+p^{a}\right)
$$

Since $n \geq 2$ you get $-1 \equiv p^{a}$ (4), so $p \equiv 3$ (4) and $a \geq 1$ odd. Now $q=m+1$ is prime and $-2 \equiv-2\left((-1)^{n}+p^{a}\right)(q)$ applies. We can reduce the $q$ odd by -2 and thus obtain $p^{a} \equiv 1-(-1)^{n}(q)$.

1st case: n even Then $p^{a} \equiv 0(q)$ and therefore $p=q$. Assuming $n \geq 3$, then $-1 \equiv(p-2) p^{a}(8)$ follows. But now $p=q \equiv 3(4)$, i.e. $p \equiv 3.7$ (8). Since $a$ is odd, you can easily check that this equation has no solution, i.e. $n=2$. Substitution shows that every $m$ that fulfills condition (i) is a solution. To summarize, in the case where $n$ is even, there are the solutions $(\mathrm{m}, 2)$, where $m+1 \equiv 3$ (4) is prime.
2nd case: n odd Write $n+1=2^{r} n^{\prime}$ with $n^{\prime}$ odd and $1 \leq r \leq n-1$. The upper bound for $r$ here comes from $2^{r} \leq n+1 \leq 2^{n-1}$ for $n \geq 3$. Because of the factorizations

$$
\begin{aligned}
m^{n+1}+1 & =\left(m^{2^{r}}+1\right)\left(m^{n+1-2 r}-m^{n+1-2 \cdot 2^{r}} \cdots+1\right) \\
m^{2^{n}}-1 & =\left(m^{2^{r}}-1\right)\left(m^{2^{r}}+1\right)\left(m^{2^{r+1}}+1\right) \ldots\left(m^{2^{n-1}+1}\right)
\end{aligned}
$$

it follows that $m^{n+1}+1$ is divisible by $m^{2^{r}}+1$ and $m^{2^{n}}-1$ is divisible by $\left(m^{2^{r}}+1\right)(m-1)$. So in total

$$
m^{2^{r}}+1 \left\lvert\, \frac{m^{2^{n}}-1}{m-1}-\left(m^{n+1}+1\right)=m p^{a}\right.
$$

Because $\left(m^{2^{r}}+1, m\right)=1$, $m^{2^{r}}+1=p^{b}$ for $1 \leq b \leq a$. Since $p \equiv 3$ (4), it follows that $b=2 c$ must be even. Therefore, $1=\left(p^{c}-m^{2^{r-1}}\right)\left(p^{c}+m^{2^{r-1}}\right)$ must also apply, a contradiction. So there is no solution in the case where $n$ is odd.