Determine all integers $n \geqslant 1$ such that $n$ divides $2^{n}-1$.

## - Polynomials in $\mathbb{Z} / p \mathbb{Z}-$

Unless otherwise stated, throughout the following, $p$ will denote a prime number, and we will work in the field $\mathbb{Z} / \mathrm{p} \mathbb{Z}$.

If $A$ is an integral domain, many results that are true in $\mathbb{Z}[X]$ remain true in $A[X]$. In particular, there exists a Euclidean division by unitary polynomials, if $r \in A$ is a root of $P \in A[X]$, then $P(X)$ is divisible by $X-r$, and a polynomial of degree $n$ has at most $n$ roots, counted with multiplicities. Consequently, if a polynomial $P$ is of degree $n$, has leading coefficient $\lambda$, has roots $r_{1}, \ldots, r_{k}$ with respective multiplicities $\alpha_{1}, \ldots, \alpha_{k}$ such that $\alpha_{1}+\ldots+\alpha_{k}=n$, then $P(X)=\lambda\left(X-r_{1}\right)^{\alpha_{1}} \ldots\left(X-r_{k}\right)^{\alpha_{k}}$. If, moreover, $A$ is a field, then there is a Euclidean division by any non-zero polynomial, and in $A[X]$ there is a GCD, an LCM, Bézout's theorem, and Gauss's theorem, and the existence and uniqueness of the decomposition into a product of irreducibles. In particular, all these properties are true in $\mathbb{Z} / p \mathbb{Z}[X]$.
$n=1$ works, and we will show that it is the only solution. Let $n \geqslant 2$, and suppose that $n \mid 2^{n}-1$. It is clear that $n$ is odd, since $2^{n}-1$ is. Let $p$ be the smallest prime divisor of $n$, and set $n=k p$. We have $p \mid\left(2^{n}-1\right)$ and by Fermat's Little Theorem, $2^{n}=\left(2^{k}\right)^{p} \equiv 2^{k} \bmod p$, so $2^{k} \equiv 1 \bmod p$. Therefore, $\omega_{p}(2) \mid k$ and $\omega_{p}(2) \mid(p-1)$. From this last divisibility relation, we deduce that all prime divisors of $\omega_{p}(2)$ are strictly less than $p$. Now, $\omega_{p}(2)>1$ since $p \geqslant 3$, and since $\omega_{p}(2) \mid k$, we conclude that $k$ has a prime divisor strictly less than $p$, and thus $n$ does as well. This contradicts the minimality of $p$.