Determine all integers $a>0$ for which there exist strictly positive integers $n, s, m_{1}, \cdots, m_{n}, k_{1}, \cdots, k_{s}$ such that

$$
\left(a^{m_{1}}-1\right) \cdots\left(a^{m_{n}}-1\right)=\left(a^{k_{1}}+1\right) \cdots\left(a^{k_{s}}+1\right)
$$
We will prove that the integers $a$ sought are $a=2$ and $a=3$.
First, we observe that $2^{2}-1=2+1$ and that $(3-1)(3-1)=3+1$, which ensures that $a=2$ and $a=3$ are indeed solutions to the problem.
Conversely, let $a, n, s, m_{1}, \cdots, m_{n}, k_{1}, \cdots, k_{s}$ be strictly positive integers such that

$$
\left(a^{m_{1}}-1\right) \cdots\left(a^{m_{n}}-1\right)=\left(a^{k_{1}}+1\right) \cdots\left(a^{k_{s}}+1\right)
$$

Clearly, we have $a \neq 1$, since if $a=1$ the right-hand side is 0 but not the left-hand side.
By contradiction: suppose that $a>3$.
We set $A=\left(a^{m_{1}}-1\right) \cdots\left(a^{m_{n}}-1\right)=\left(a^{k_{1}}+1\right) \cdots\left(a^{k_{s}}+1\right)$.
Lemma 1. Each of the numbers $m_{1}, \cdots, m_{n}$ and $a-1$ is a power of 2.
Proof of Lemma 1. Let $i \in\{1, \cdots, n\}$ and $\gamma$ be an odd divisor of $m_{i}$ (possibly $\gamma=1$), say $m_{i}=\gamma \times b$. Let $p$ be a prime divisor of $a^{\gamma}-1$.
Since $a^{\gamma} \equiv 1(\bmod p)$, we have $a^{m_{i}} \equiv\left(a^{\gamma}\right)^{b} \equiv 1(\bmod p)$.
Thus $A$ is divisible by $p$, which ensures that there exists $j$ such that $a^{k_{j}}+1$ is divisible by $p$. As above, we then have $\left(a^{\gamma}\right)^{k_{j}}-1 \equiv 0(\bmod p)$ and, since $\gamma$ is odd, we also have $\left(a^{k_{j}}\right)^{\gamma} \equiv-1$ $(\bmod p)$.
Hence $p$ divides $\left(\left(a^{k_{j}}\right)^{\gamma}+1\right)-\left(\left(a^{\gamma}\right)^{k_{j}}-1\right)=2$, so $p=2$.
Thus, the only prime divisor of $a^{\gamma}-1$ is $p=2$, which proves that $a^{\gamma}-1$ is a power of 2. There exists an integer $c$ such that

$$
2^{c}=a^{\gamma}-1=(a-1)\left(a^{\gamma-1}+\cdots+a+1\right) .
$$

In particular, $a-1$ is therefore a power of 2 and $a$ is odd. But, since $\gamma$ is odd, $a^{\gamma-1}+\cdots+a+1$ is odd and must also be a power of 2. This implies that $\gamma=1$ and thus that the only odd divisor of $m_{i}$ is 1, which concludes the proof of Lemma 1.
From the lemma, we have $a-1=2^{c}$ and $a-1>2$, so $a-1$ is divisible by 4. For any integer $k \geq 0$, we then have $a^{k}+1 \equiv 2(\bmod 4)$.
For all $i$, we set $a_{i}=\frac{1}{2}\left(a^{2^{i}}+1\right)$. We know that $a_{i}$ is an odd integer.
We easily verify by induction that, for any integer $d \geq 0$ :

$$
a^{2^{d}}-1=(a-1)(a+1)\left(a^{2}+1\right) \cdots\left(a^{2^{d-1}}+1\right)=2^{c} \cdot 2^{d} \cdot a_{0} a_{1} \cdots a_{d-1}
$$

Lemma 2. The numbers $a_{0}, a_{1}, a_{2}, \cdots$ are pairwise coprime.
Proof of Lemma 2. Let $0 \leq iN_{0}+\cdots N_{q}$. Since each $a^{k_{j}}+1$ is congruent to 2 modulo 4, we must therefore have $s=N$. For all $j$, if we set $k_{j}=2^{r} t$ with $t$ odd, then $a^{k_{j}}+1=\left(a^{2^{r}}\right)^{t}+1 \equiv(-1)^{t}+1 \equiv 0$ $(\bmod 2)^{r}+1$. Thus $a^{k_{j}}+1$ is divisible by $a_{r}$.
Thus, each of the numbers $a^{k_{j}}+1$ is divisible by one of the $a_{i}$. Since $s>N_{0}+\cdots N_{q}$, there exists $i$ for which $a_{i}$ divides more than $N_{i}$ of the $a^{k_{j}}+1$. Hence, $A$ is divisible by $\left(a_{i}\right)^{N_{i}+1}$, which is impossible according to (2), since $a_{i}$ is odd and coprime with each of the other $a_{j}$ according to Lemma 2.