36. Find all positive integer triples $(a, m, n)$ such that
$$\left(a^{m}+1\right) \mid(a+1)^{n}$$
36. Notice that when $a, m$ is equal to 1, it is easy to get the positive integer solutions $(a, m, n)=(1, m, n)$ or $(a, 1, n)$, where $a, m, n \in \mathbf{N}^{*}$.

Below, we discuss the case where $a, m$ are both greater than 1.
First, we prove a lemma: Let $u, v, l \in \mathbf{N}^{*}$, and $u \mid v^{l}$, then $u \mid(u, v)^{l}$.
In fact, let $u=p_{1}^{\sigma_{1}} p_{2}^{\sigma_{2}} \cdots p_{k}^{\sigma_{k}}$, $v=p_{1}^{\beta_{1}} p_{2}^{\beta_{2}} \cdots p_{k}^{\beta_{k}}$, here $p_{1}1$, thus $\left(a^{m}+1, a+1\right)$ $>1$, so $\left(a^{m}+1, a+1\right)=2$. This way, by the lemma, $\left(a^{m}+1\right) \mid 2^{n}$, hence $a^{m}+1=$ $2^{s}$, where $s$ is some positive integer. Given $a>1$, we know $s \geqslant 2$, requiring $a^{m}+1 \equiv 0(\bmod 4)$, but when $m$ is even, $a^{m} \equiv 0$ or $1(\bmod 4)$, which is a contradiction.

If $m$ is odd, by $m>1$, we know $n>1$. Let $p$ be a prime factor of $m$, and set $m=p r$, $b=a^{r}$, $r$ is a positive odd number. Then, by the condition, $\left(b^{p}+1\right) \mid(a+1)^{n}$. And $(a+1) \mid\left(a^{r}+\right.$ $1)$, i.e., $(a+1) \mid(b+1)$, so, $\left(b^{p}+1\right) \mid(b+1)^{n}$, i.e., $\left.\frac{b^{p}+1}{b+1} \right\rvert\,(b+1)^{n-1}$. Note that,
$$\begin{aligned}
B & =\frac{b^{p}+1}{b+1}=b^{p-1}-b^{p-2}+\cdots-b+1 \\
& \equiv(-1)^{p-1}-(-1)^{p-2}+\cdots-(-1)+1 \\
& =p(\bmod b+1)
\end{aligned}$$

Thus, $(B, b+1) \mid p$. Combining $B>1$ and $B \mid(b+1)^{n-1}$, we know $(B, b+1)>1$, hence $(B, b+1)=p$. Using the lemma, we get $B \mid p^{n-1}$, thus $B$ is a power of $p$.

Now, let $b=p k-1, k \in \mathbf{N}^{*}$, then by the binomial theorem, we know
$$\begin{aligned}
b^{p}+1 & =(p k-1)^{p}+1 \\
& =(k p)^{p}-\mathrm{C}_{p}^{p-1}(k p)^{p-1}-\cdots-\mathrm{C}_{p}^{2}(k p)^{2}+k p^{2} \\
& \equiv k p^{2}\left(\bmod k p^{3}\right)
\end{aligned}$$

Therefore, $B=\frac{b^{p}+1}{b+1}=\frac{b^{p}+1}{k p} \equiv p\left(\bmod p^{2}\right)$, hence $p^{2} \times B$, so $B=p$.
When $p \geqslant 5$,
$$\begin{aligned}
B & =\frac{b^{p}+1}{b+1}=b^{p-1}-b^{p-2}+\cdots-b+1>b^{p-1}-(b-1) b^{p-2} \\
& =b^{p-2} \geqslant 2^{p-2}>p
\end{aligned}$$

Thus, by $B=p$, we know, it can only be $p=3$. At this time, $b^{2}-b+1=3$, solving gives $b=2$, then $a=$ $2, r=1$. At this moment, $m=p r=3$. And obviously, $(a, m, n)=(2,3, n)$ satisfies the condition when $n \geqslant 2$.

Therefore, the positive integer solutions $(a, m, n)=(1, m, n)(a, 1, n)$ or $(2,3, r)$, where $a, m, n, r \in \mathbf{N}^{*}, r \geqslant 2$.