Why are mathematicians so interested in finding out the gaps between primes and the distribution (randomness) in primes? I'm a high school student, and I came across an article that mentioned Kanan Soundararajan's and his student's work regarding the patterns in 'random' primes. And I also read about Yitang Zhang's and James Maynard's work on the gap between primes. I was wondering why are mathematicians so interested in this. What motivates them to find out answers to these problems? I'm guessing that it would be something related to the Riemann hypothesis (not sure). 
 A: Primes are the basic building blocks of the integers due to the Fundamental Theorem of Arithmetic which states that every integer can be written as the product of primes in a unique way.
Hence heuristically it would be logical to study the properties of primes, similar to why chemists study elements in the periodic table since every compound is made up of elements.
A: I agree along the line of Tobias comment:


*

*Primes are certain whole numbers and like other problems involving whole numbers, one has many problems which are easy to state, but very hard to proof. 


That is why those problems are widely known. 
Only few mathematicians get paid (not counting the hundreds of mathematicians working for the security agencies) to bang their heads against very hard problems with unknown prospect of success which need a lot of knowledge in very special areas with no wide use.
Further:


*

*Splitting a whole number into its prime factors is much harder than the inverse problem, multiplying a couple of prime numbers into one whole number. That is why it is used as one-way function in cryptography, which has a huge practical importance.

*One of the problems regarding primes is to come up with a simple way to calculate the $n$-th prime number. The known methods are more or less trial and error. The two extreme opinions on this are: 


*

*There is no law, prime numbers are random picks by nature. 

*The distribution is not random, but anywhere from very complex to simple but unknown yet. 



Some lucky girl might come up with 2. any day. For 1. there are reasons to believe that this is too extreme, as certain patterns regarding the whole distribution of primes have been found.
