Recent understandings of molecular evolution, together with the fossil records, have established that there are both linear and nonlinear processes in the creation of novel species, which is strikingly similar to the generation of prime numbers and human creativity. Each creation of a more complex species is like a prime number, unpredictable, discontinuous, and yet can be modeled by a smooth curve in relation to time. The mystery behind the complexity increases in nature and human civilizations might well turn out to be similar to that behind the appearances of prime numbers. Here we show that an algorithm for the creative process of humans can create prime numbers in a lawful and yet unpredictable fashion. The essence of primes is the duality of uniqueness and uniformity together with the creation algorithm. The algorithm consists of the non-linear process of uniformity selection to create the unique and the linear process of uniqueness selection to form the uniformity. The iterations of this algorithm can create an infinite number of primes. The algorithm appears to have been hardwired in the human brain as shown by recent experimental studies. This new understanding can deduce some of the best-known properties of primes and may explain the nearly constant and yet seemingly random creation of novelty in relation to time.