6. Given the set
$$
A=\left\{n \in \mathbf{Z} \left\lvert\,\left(1+\frac{1}{n}\right)^{n+1}=\left(1+\frac{1}{2020}\right)^{2000}\right.\right\} \text {. }
$$

Then the number of elements in set $A$ is $\qquad$ .
6. 1 .

Let $a_{n}=\left(1+\frac{1}{n}\right)^{n}\left(n \in \mathbf{Z}_{+}\right)$,
$$
b_{n}=\left(1+\frac{1}{n}\right)^{n+1}\left(n \in \mathbf{Z}_{+}\right) \text {. }
$$

By the mean value inequality, we have
$$
\begin{array}{l}
a_{n}=\left(1+\frac{1}{n}\right)^{n}=\left(1+\frac{1}{n}\right)^{n} \cdot 1 \\
<\left(\frac{\frac{n+1}{n} \cdot n+1}{n+1}\right)^{n+1}=\left(1+\frac{1}{n+1}\right)^{n+1} \\
=a_{n+1}, \\
\frac{1}{b_{n}}=\left(\frac{n}{n+1}\right)^{n+1}=\left(\frac{n}{n+1}\right)^{n+1} \cdot 1 \\
<\left(\frac{\frac{n}{n+1}(n+1)+1}{n+2}\right)^{n+2}=\left(\frac{n+1}{n+2}\right)^{n+2} \\
=\frac{1}{b_{n+1}} .
\end{array}
$$

Thus, $a_{n}$ is monotonically increasing, and $b_{n}$ is monotonically decreasing.
By $\frac{x}{1+x} \leqslant \ln (1+x) \leqslant x$, we get
$$
\left(1+\frac{1}{n}\right)^{n}<\mathrm{e}<\left(1+\frac{1}{n}\right)^{n+1} \text {. }
$$

Therefore, when $n \in \mathbf{Z}_{+}$,
$$
\left(1+\frac{1}{2020}\right)^{2020}<\mathrm{e}<\left(1+\frac{1}{n}\right)^{n+1} \text {, }
$$

the original equation has no solution.
When $n \in \mathbf{Z}_{+}$, let $n=-m\left(m \in \mathbf{Z}_{+}\right)$,
$$
\begin{array}{l}
\left(1+\frac{1}{n}\right)^{n+1}=\left(1+\frac{1}{-m}\right)^{-m+1} \\
=\left(1+\frac{1}{m-1}\right)^{m-1}=\left(1+\frac{1}{2020}\right)^{2020} .
\end{array}
$$

Since $a_{n}=\left(1+\frac{1}{n}\right)^{n}$ is monotonically increasing, the above equation has a unique solution $m=2021$, at which point, $n=-2021$.

In summary, the original equation has only one integer root, and the set $A$ has only one element.