Why are special numbers important? (Such as fermat prime, mersenne prime) 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: 
I cannot see either the motivation or the importance behind studying special numbers $($such as Fermat primes, Mersenne primes$)$.

$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$)$.

Why are we studying this? Is it just a purely number theoretic question?

See my answer to this question.
A: Mersenne numbers and Fermat numbers are very close to $2^n$, 1 more or 1 less, and thus have been studied first by ancient Mathematicians. Also they have unique properties that enable to build very efficient primality tests (LLT for both, with seed 4 for Mersennes and seed 5 for Fermats). The technics used for proving these primality tests may sometimes be extended or modified for proving numbers a little bit different to be prime. The first primality test was created by Edouard Lucas and used for proving that a Fermat number is not prime. Then he used the same technic for proving that Mersenne number $M_{127}$ is prime. That's history. And that's also an easier way to start studying Number Theory. Fermat and Mersenne numbers have plenty of properties, like: $M_q = 2^q-1 = (8x)^2-(3qy)^2 = (1+Sq)^2 - (Dq)^2$ .
Try to prove it before looking at solution: http://tony.reix.free.fr/Mersenne/Mersenne8x3qy.pdf .
