Could you help me answering this question?
For which Mersenne primes and Fermat primes is 2 a primitive root?
I know that a $a$ is a primitive root modulo $n$ if $a$ generates $\mathbb{Z}_n^*$.
A Mersenne prime is a prime of the form $M_p=2^p-1$, with $p$ prime.
A Fermat prime is a prime of the form $2^{2^n}+1$, with $n\in \mathbb{N}$.
Thank a lot :)
Let $2^p - 1$ be a Mersenne prime and consider the subgroup of $\mathbb{F}_{2^p-1}^\ast$ generated by 2. It consists of $\{1, 2, 4, \ldots, 2^{p-1}\}$ since $$2^p \equiv 1 \pmod{2^p - 1}$$ and those elements are unique since each is less than $2^p - 1$. So that's a total of precisely $p$ elements in the subgroup $\langle 2 \rangle$.
So ask yourself: when is this the entirety of $\mathbb{F}_{2^p-1}^\ast$?