Whenever I studied topics in mathematics, I found those topics are important in purely mathematical sense and I could see some motivations.
However, I cannot see neither motivation nor importance of studying special numbers (such as fermat prime, mersenne prime). Why are we studying this? Is it just a purely number theoretic question?
Special numbers such as $e$ and $\gamma$(Euler-Mascheroni) frequently occur naturally, but I think those special primes are really artificially constructed..
$a^n-1$ is always divisible by $a-1$, and hence non-prime, or composite $\ldots$ Oh, wait ! Unless $a-1$ $=1\iff a=2$. $($This explains the mathematical interest in Mersenne primes$)$. Also, $a^n+1$ is always divisible by $a+1$, and hence non-prime, or composite $\ldots$ unless $n=2^k$. $($This explains the mathematical interest in Fermat primes; see also$)$.
See my answer to this question.