Available online at www.sciencedirect.com Chaos, Solitons and Fractals 37 (2008) 23–42 www.elsevier.com/locate/chaos The distribution of prime numbers: The solution comes from dynamical processes and genetic algorithms Gerardo Iovane * Dipartimento di Ingegneria dell’Informazione e Matematica Applicata, Universitá di Salerno, Via Ponte don Melillo, 84084 Fisciano (Sa), Italy INFN-LNF (Laboratori Nazionali di Frascati), 00044 Frascati (Rome), Italy Accepted 10 October 2007 Abstract In this work, we show that the set of primes can be obtained through dynamical processes. Indeed, we see that behind their generation there is an apparent stochastic process; this is obtained with the combination of two processes: a ‘‘zig-zag’’ between two classes of primes and an intermittent process (that is a selection rule to exclude some prime candidates of the classes). Although we start with a stochastic process, the knowledge of its inner properties in terms of zig-zagging and intermittent processes gives us a deterministic and analytic way to generate the distribution of prime numbers. Thanks to genetic algorithms and evolution systems, as we will see, we answer some of most relevant questions of the last two centuries, that is ‘‘How can we know a priori if a number is prime or not? Or similarly, does the generation of number primes follow a specific rule and if yes what is its form? Moreover, has it a deterministic or stochastic form?’’ To reach these results we start to analyze prime numbers by using binary representation and building a hierarchy among derivative classes. We obtain for the first time an explicit relation for generating the full set Pn of prime numbers smaller than n or equal to n. 2007 Elsevier Ltd. All rights reserved. 1. Introduction One of the most famous open questions in Mathematics is that regarding the distribution of prime numbers, although primes have been studied since the early beginning of Mathematical Sciences [1,2]. During the last two centuries many mathematicians have attempted to solve this problem using different methods (see, for example [1–9]). Nowadays the mathematical techniques applied for discovering new primes and the prime distribution represent the maximum human level of complexity in pure Mathematics and Computer Science. The arithmetic of prime numbers plays a crucial role in Cryptography and Information Security. Indeed, many cryptosystems, such as RSA, XTR, and ECC (Elliptic Curve Cryptosystems), are based on our historical ignorance about the inner nature of primality. * Address: Dipartimento di Ingegneria dell’Informazione e Matematica Applicata, Universitá di Salerno, Via Ponte don Melillo, 84084 Fisciano (Sa), Italy. E-mail address: iovane@diima.unisa.it 0960-0779/$ - see front matter 2007 Elsevier Ltd. All rights reserved. doi:10.1016/j.chaos.2007.10.017 24 G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 In addition, many papers are devoted to primes in the physical literature; a sort of mathematical blueprint seems to guide the evolution of structures at different length scales [10–16]. As shown by El Naschie in the context of E-Infinity in [17], the solutions of some specific quadratic and cubic algebraic equations give the inverse electromagnetic fine structure constant, that is the prime 137, as well as the quantum gravity couplings constants. In [13,14], Berry and Keating made a surprising and still-mysterious discovery, that is the arrangement of energy levels in quantum chaology is related to one of the deepest problems in mathematics, involving patterns in the prime numbers. If we think about the effort for understanding the distribution of prime numbers and the complex, interesting and so relevant results reached until now, we must conclude that the solution could appear as insult to the human intelligence and evolution. But at the same time the author is encouraged by a historical sentence by Fields Medalist Prof. E. Bombieri, that is, more or less the following: ‘When things become too complex, sometimes it makes sense to stop and ask: is my question right?’ Moreover, another encouragement comes from the well-known sentence in the Fine Hall of Princeton: ‘‘Raffiniert ist der Herr Gott, aber boshaft ist Er nicht’’. Thus, the main ideas used as starting point of this work are as follows: • The use of a simple language to represent the objects of interest (i.e. primes) generated by a dynamical process (i.e. an advanced counting that consider only primes) and to answer the question will start by using the binary representation. • In many fields, Nature manifests itself through beautiful symmetries and harmonies based on primes in such a way that we can understand some interesting results thanks to primality. Consequently, if we assume that physical phenomena can be explained in terms of primes, then the primes distribution could also be discovered by using well-known dynamical processes (for instance, we can consider random walk and log-random processes). From this perspective I focus attention on: • the binary representation of primes and their properties in terms of modular arithmetic and elliptic curves [18–22]; • the use of the Artificial Intelligence (i.e. the genetic algorithms and the evolution systems) to realize an intelligent counting procedure (i.e. reduced spaces of counting); • the dynamical processes which can be applied to prime numbers generation [23–25]. At the end of this analysis, we can conclude that probably in 1990 R.C. Vaughan made a mistake, when He stated ‘‘It is evident that primes are randomly distributed, but unfortunately we don’t know what ‘random’ means’’, as we will see that the sequence of primes can be generated trough a deterministic procedure by solving the apparent randomness. The paper is organized as follows. In Section 2, we consider some classes of prime candidates using binary representation; Section 3 is devoted to genetic algorithms and stochastic processes to reach an analytic approach for obtaining primes sequences; in Section 4, we prove the selection rules, which reduce the two sets of prime candidates to two pure sets of primes; Section 5 shows a trivial prototype of the computational procedure to obtain the sequence of primes, while the conclusion are in Section 6. 2. Binary representation and classes of prime candidates Human behaviour in numerical evolution is based on decimal representation, but what can we say about computational and artificial intelligent machines? Moreover, what is the simplest way to represent a number? In addition in Physics as in Philosophy the dynamical evolution among different states is guided by the competition of two opposite competitors. Then we use the binary representation, that is the competition between ‘‘TRUE’’ and ‘‘FALSE’’ or goodness and badness or zero (vacuum, nothing) and one (total, whole), to obtain what we can call the language of Nature, that is primes in their full harmony. In the history of scientific progress this is not the first time that following the root of beauty, someone has discovered a fundamental law, an inner property of Nature. Thanks to binary representation the primes generation appears to be not chaotic, but self-similar. As we will see here, thanks to the binary representation, we can foresee that behind the primes generation, a deterministic dynamical process can explain the distribution of primes in N. In the last three decades, some works have been presented in the direction of binary representation, but probably we can see them just like the starting point of a beautiful world to discover (for more details see [26–30,18]). In 1971, Oliver showed that the number of primes n 6 x having an even number of TRUE bits tends to p(x)/2 asymptotically [18]. This result is interesting, but in 1994 Montgomery suggested that Oliver’s proof is incomplete. Indeed, the proof is not only incomplete, but many other interesting properties of primes emerging in binary representation exist. G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 25 A prime number p can be written as1 p ¼ a 2; with a 2 1n, 2 2 Vn, where 1n is a n-dimensional vector space and ai = 0,1, and with Vn a n-dimensional vector space and 2 = (2n, 2n1, . . . , 20). Using this representation, we can summarize the following properties. If we call Nn the set of numbers with n digits, then the cardinality of Nn is card(Nn) = jNnj = 2n1. If we call On the set of odd numbers with n digits then the cardinality of On is card(On) = jOnj = 2n2. The primes have the last digit (right one) set on TRUE (i.e. 1). The primes have the first digit (left one) set on TRUE (i.e. 1) with the exception of the prime two, that is ‘‘FT’’ (i.e. 01). • If we call M0 the class containing numbers with a binary representation of the type T . . . FT . . . FT, then these numbd bd bers are not primes, with the exception of the first number, that is TFT ¼ 5, where the symbol ¼ indicates the equivalence between the binary and decimal representation. • If we call M5 the class containing numbers with a binary representation of the type TFT(NF)TFT 8n 2 N, then these numbers are not primes, but they are multiple of 5. • If we call M3 the class containing numbers with a binary representation of the type TFT(NT)TFT 8n 2 N, then these numbers are not primes, but they are multiple of 3. • • • • 2.1. One-parameter classes or classes of the first-order Let us introduce the following operators in binary representation } : Vnb ! Vb , where the b stands for binary, and the action of the operator is the concatenation of two strings representing two positive integer numbers expressed through binary representation, that is (a, b) = a b, where a and b are two Boolean or two binary strings representing two fixed positive integer numbers; ~ : Vb ! Vb , the action of the operator is to reverse a Boolean string representing a fixed number, that is ~ðaÞ ¼ e a, where e a is the positive integer number represented by the reversed string representing a in the binary representation; }e ¼ }~ is the operator obtained by combining the two previous operators; here we stress that they do not commutate, that is ½};~ 6¼ 0. Moreover, we will use the symbol to indicate the product between a positive integer and the Boolean TRUE (T). Here, we see some examples about the action of the previous operators: (a) it is very curious that by concatenating two primes often we can obtain again a prime, i.e. TTFT TFFFT = TTFTTFFFT: using the decimal representation this means 11 17 = 283; (b) similar results can be obtained by using the reverse operator; as an example we can consider the string TFTTT representing in base ten the number 29, but if we read the previous strings in the reverse order, that is g ¼ TTTFT we obtain the number 23; TFTTT e ¼ TTFT}FT g (c) analogously, we have 11 }2 ¼ TFTFTT ¼ 53. Starting from the previous experimental assumptions, thanks to the induction principle and indicating with S the set of the strings representing positive integers s, using the binary representation, we can prove the following theorem. Theorem. Using the binary representation the primes can be classified in classes depending on a set of parameters. In particular, we can give as an example the following 1-parameter classes C ð1Þ r , where the upper index reminds us that we are considering classes depending on only one parameter. ð1Þ bd • C 1 ¼ fs 2 S : s ¼ p T ¼ 2p1 with p 2 P N; p > 1g, where P is the set of prime numbers and N is the set of positive integers; bd ð1Þ • C 2 ¼ fs 2 S : s ¼ T }ððm 1Þ F Þ}T ¼ 2m þ 1 with m 2 N; m > 1 and m odd numbersg; ð1Þ bd • C 3 ¼ fs 2 S : s ¼ ð2 T Þ}ðn F Þ}T ¼ 20 þ 21 þ 22 2n with n 2 N; n P 1g; 1 In this paper, we have to read the binary representation of numbers from the left to right (i.e 2 is FT and not TF). 26 G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 ð1Þ bd • C 4 ¼ fs 2 S : s ¼ T }ðn F Þ}ð2 T Þ ¼ 20 þ 21 2n þ 22 2n with n 2 N; n P 1g; bd ð1Þ • C 5 ¼ fs 2 S : s ¼ ðT }F }T Þ}ðn F Þ}T ¼ 20 þ 22 þ 23 2n with n 2 N; n > 1g; bd ð1Þ • C 6 ¼ fs 2 S : s ¼ T }ðn F Þ}ðT }F }T Þ ¼ 20 þ 21 2n þ 23 2n with n 2 N; n > 1g; bd ð1Þ • C 7 ¼ fs 2 S : s ¼ ð2 T Þ}ðn F Þ}ðT }F }T Þ ¼ 20 þ 21 þ 22 2n þ 24 2n with n 2 N; n P 0g; • • • • • ð1Þ C8 ð1Þ C9 ð1Þ C 10 ð1Þ C 11 ð1Þ C 12 bd ¼ fs 2 S : s ¼ ðT }F }T Þ}ðn F Þ}ð2 T Þ ¼ 20 þ 22 þ 23 2n þ 24 2n with n 2 N; n P 0g; P bd ¼ fs 2 S : s ¼ T }F }ðn T Þ ¼ 2 ni¼1 2i with n 2 N; n P 1g; bd P i nþ1 ¼ fs 2 S : s ¼ ðn T Þ}F }T ¼ n1 with n 2 N; n P 1g; i¼0 2 þ 2 bd ¼ fs 2 S : s ¼ ð3 T Þ}ð2n F Þ}ðT }F }T Þ ¼ 20 þ 2 þ 22 2n þ 24 2n with n 2 N; n > 1g; bd ¼ fs 2 S : s ¼ ðT }F }T Þ}ð2n F Þ}ð3 T Þ ¼ 20 þ 22 þ 22nþ3 þ 22nþ4 þ 22nþ5 with n 2 N; n P 0g. From the previous classes, it clearly appears that good candidates to primality can be obtained starting from the operators fixed above and by combining the trivial strings (T, F, TF, FT) with the strings representing prime numbers like as TFT = 5, p T, and so on. The previous classification shows us in which way, with respect to primes, Nature can manifest itself in a beautiful regularity and symmetry. At this point an interesting question is if it is possible to generalize the previous classification. To answer this question we can consider the 2-parameter classes. 2.2. Two-parameters classes or classes of the second-order Following the previous approach we can easily obtain the following classes of the second-order. ð2Þ bd • • • • • ð2Þ C2 ð2Þ C3 ð2Þ C4 ð2Þ C5 ð2Þ C6 Pm1 2i þ 2m 2n g; P ¼ fs 2 S : s ¼ T }ðn F Þ}ðm T Þ ¼ 20 þ 2n mi¼1 2i g; • C 1 ¼ fs 2 S : s ¼ ðm T Þ}ðn F Þ}T ¼ i¼0 bd P bd ¼ fs 2 S : s ¼ ðT }F }T Þ}ðn F Þ}ðm T Þ ¼ 20 þ 22 þ 2n mi¼1 2iþ2 g; bd P i m n mþ2 ¼ fs 2 S : s ¼ ðm T Þ}ðn F Þ}ðT }F }T Þ ¼ m1 2n g; i¼0 2 þ 2 2 þ 2 bd ¼ fs 2 S : s ¼ T }ðn F Þ}ðT }ðm F Þ}T Þ ¼ 20 þ 21 2n ð20 þ 21 2m Þg; Pn i bd P j m ¼ fs 2 S : s ¼ ðm T Þ}F }ðn T Þ ¼ m1 j¼0 2 þ 2 i¼1 2 g. The 2-parameter classes show us in which way, with respect to primes, Nature can manifest itself again in a beautiful regularity and symmetry as for the 1-parameter classes, but also in a self-similar fashion. The previous classes can be generalized and can furnish as result a reduced set of candidates to primality. The number of parameters we can introduce has an upper limit in the number of digits of the Boolean strings to consider, and then the maximum number of jumps between the Boolean T and F. If we go on with the creation of new class we will discover, the special role of the two strings FT, TT and their special combinations as shown in the previous analysis and again in the following section. Consequently, a statistical analysis can give interesting results too. Although this approach is interesting from a computational point of view and is useful to consider classes of possible candidates to primality, it does not give a rule to assure an order. In other words, we cannot know if between the last known prime and our new one (current candidate), other primes exist too. For this reason in the following section we will consider genetic algorithms and dynamical processes to obtain an analytic relation. 3. Towards an analytical approach based on the anthropic principle, genetic algorithms, and stochastic processes Starting from the results of the previous section we can understand that the first two Boolean values (0 and 1, that is F and T) do not play the same relevant role of 2 and 3, FT and TT. This means that in binary representation while 0 and 1 give just the language, that means in some way that they are neutral, the binary strings FT and TT assume the role that we can assimilate to Adam and Eve for humans. They are the first mother and father of the numbers. They have a common seed T (the right digit), but differ from the left digit (F for the first number and T for the second one). The anthropic principle appears in many fields as a fundamental support for developing some relevant theories. Just to give an example in cosmology, it can be used to select among different theories and different models of Universe, the approaches which are compatible with the human life on Earth. In a similar way, we can assume that also in Mathe- G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 27 matics the anthropic principle plays such a role that the human intelligence can produce an evolution computation so that we realize our scientific progress era by era. Unfortunately, it appears clearly that the anthropic principle, although very suggestive, is not enough to start our investigation on primes, since it could give us the initial condition (or if you prefer the final condition), but it gives no information about the evolution, i.e. it does not furnish information about the dynamical process behind the numeric generation or primes sequence. To answer this question, let us introduce the evolution systems and the genetic algorithms. Genetic algorithms (GA) are used in scientific contexts to solve problems about computational models for natural evolution systems. We find their applications not only in the Information Theory, but also to study dynamical processes, in the Game Theory, in Molecular Biology, in Physics, Ecology, Evolution Biology, Genetics, and so on. Starting from 1950 many scientists have studied the evolution systems to solve some optimization problems in different fields. In 1960, Rechemberg was the first scientist, who introduced the term ‘‘evolutionsstrategie’’. Starting from 1966 Fogel, Owens and Welsh considered the evolution computation. In the same period with the studies of the socalled ’’Adaptation in Natural and Artificial systems’’ the development of GA started thanks to the work of Holland at the Michigan University [31]. The Holland approach can be used to move from a population of chromosomes (i.e. a sequence of binary bits) to another sequence. Each chromosome is made of genes (i.e. single bit or their small strings) on which different rules can act to obtain a new sequence. Indeed, these rules are the natural selection, the coupling, the inversion and mutation rules (they can be seen also as operators or processes). In our case by using binary representation, the genes can be of two types, named allele, that is TRUE or FALSE. The selection rule takes the chromosomes which have greater and greater reproduction capability, and so they are the best candidates for creating descendants. The coupling rule produces the natural biological recombination process between organisms with only one type of chromosomes, the so-called haploids. The mutation rule transforms the value of alleles in a fixed chromosome in a random fashion; while the inversion rule reverses the order of a part or the totality of a fixed chromosome. In Number Theory, the role of chromosomes is played by the numbers, which can be written as sequences of digits (or bits), that is numeric filaments of DNA. The single digit, written in such a base, are the genes, while the alleles are the components of the base: for example, using the decimal base, we have 10 alleles, and so on. The position of an allele in a chromosome is the locus. This means for example that, using binary representation, a TRUE value in a different locus gives us a different power of two. The total set of the genetic material is the genome. Consequently, in our study we are dealing with the genome of Mathematics. The different classes of genes are known as genotypes. Then we have to study if primes have got genotypes. As it is well known, among primes there are the Twins, which are named diploids in the genetic language (i.e. couples of chromosomes). The numbers 2 and 3 are the parent haploids (for this reason above we call them Adam and Eve). If we define the fitness function f in terms of the probability P of coupling (i.e. vitality), then by naming a0 = 2 and b0 = 3 we have that the fitness is f1 ða0 Þ ¼ P ða0 Þ ¼ f2 ðb0 Þ ¼ P ðb0 Þ ¼ 1; ð3:1Þ while if the fitness is expressed in terms of the number of generations of descendants (i.e. fertility) then f1 ða0 Þ ¼ lim g1 ðkÞ ¼ f2 ðb0 Þ ¼ lim g2 ðkÞ ¼ 1; k!1 k!1 ð3:2Þ where k is the order of lineage (i.e. k = 1 – son, k = 2 – nephew and so on), while we have used f1 and f2, and g1 and g2 instead of f and g for generality. In this scenario, suppose that the coupling is given by the standard operation ‘‘·’’ between the two integers a0 = 2 and b0 = 3; then for the following generations of numbers the integers 6 = 2 · 3 must play a special role, since it represents the coupling and the possibility to generate.2 Suppose to distinguish different generations thanks to a parameter k 2 N: this means that for k = 1 we have the direct descendant of Adam and Eve, their son, while for k = 2 their nephew and so on as anticipated. Moreover, we must distinguish between female and male descendants. Consequently, using an analogy with Adam and Eve, which differ for one unit only, we can build the following two sets of prime candidates: A ¼ fak 2 N : ak ¼ 6k 1 with k 2 Ng ð3:3Þ B ¼ fbk 2 N : bk ¼ 6k þ 1 with k 2 Ng; ð3:4Þ and 2 It is well known a perfect number is defined as an integer which is the sum of its proper positive divisors, that is, the sum of the positive divisors not including the number. Equivalently, a perfect number is a number that is half the sum of all of its positive divisors, or r(n) = 2 n. It is very interesting to stress that the first perfect number is 6, because 1, 2 and 3 are its proper positive divisors and 1 + 2 + 3 = 6. 28 G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 It is very interesting to verify that starting from the previous genetic consideration the previous two classes contain primes numbers. Unfortunately, they also contain not-primes numbers such as the positive integers, which are multiple of 5, and so on. Consequently, the previous sets are interesting as candidate sets to primality, but they are not pure sets of primes. In other words, we must introduce a selection rule to explain the primality. We try to solve this question in what follows and in the following section. Here, we can give the following hypothesis. Hypothesis 0. Each prime candidate x P 5 belongs to one of the following two sets: A ¼ fak 2 N : ak ¼ 6k 1 with k 2 Ng; B ¼ fbk 2 N : bk ¼ 6k þ 1 with k 2 Ng; or equivalently the sets A and B are the genotypes of the Number Theory and the primes are the genome of the numbers. In terms of optimization and control techniques, for testing our results let us introduce the search space C; it is the space of the candidate solutions to our main problem (i.e. the primes generation). Moreover, let us consider a control metric or a distance function given by S n ¼ pCn pP n ¼ jC n j jP n j; ð3:5Þ where C n C, pCn is the number of candidates to the primality, which are smaller than n or equal to n and pP n is given by the Gauss p function, that is p(n) ffi n/log(n), and jXj = card(X). The solution S of our problem will be given through a sequence of approximation for minimizing Sn. This means that the minimization will be optimal for S = P with P – set of primes. To restrict the search space, we could consider the subspace Cn so that the cardinality jC n j < n: ð3:6Þ Examples of Cn are the Mersenne, Fermat, Crandall, Solinas sets or the classes in the previous section, considered by using the binary representation. Unfortunately, none of the previous sets give us P totally. This means that we cannot reduce roughly the cardinality of C, but it needs a deep knowledge of the primes genotypes and the selection rules acting on them. For this reason in the previous section we made a deep analysis of the structures of primes, considered as Boolean bit sequences. The result reached was that primes are obtained by primes with a high probability. Indeed, for GA it is common to suppose that candidate solutions in the search space at a fixed order i of approximation (i generator) can produce, at the order i + 1 (descendants), solutions of high quality through combination. A relevant concept for selecting only primes in A and B is the fitness landscape. This was introduced for the first time by the biologist Wright in 1931 in the context of the generation of populations. It is the representation of the space of all genotypes with their fitness. As anticipated above, our genotypes are represented by the sets A and B, while in what follows we will try to answer the question of the fitness after their reduction to pure classes of primes. By working very well on this step, we will obtain Pn exactly in terms of A and B. By following the Wright formulation the evolution moves the populations through the landscape in such a way that the adaptation pushes the population towards local peaks (or local optimal points). Consequently, the coupling (or generation) and selection rules act in order that the population of primes candidates moves into the fitness landscape in the best way, that is by producing only primes in the sequence. We try to answer this question in the next section using the dynamical process instead of genetic rules to simplify the procedure and to obtain a formal representation of the results. However, we wish to stress that in the context of the Information Theory and Knowledge Discovery, the advantage of GA, with respect to the traditional search methods, is that when we start a search by using GA in a specific space of candidate solutions, we do not go on creating all the possible candidate solutions for doing the evaluation only at the end. In other words, the GA is a method to find optimal solutions by considering a restricted set of candidate solutions only, and this is our case. A useful expression to estimate (3.5) will be the following: pðnÞ ¼ 2 þ pA ðnÞ þ pB ðnÞ ð3:7Þ with p(n) = n/log(n) and the index * denoting subsets of A and B including only primes; moreover, the reason for which we have added 2 is due to the fact that the set A and B do not contain the first two primes, 2 and 3. Here, we only bring forward that the selection rules can be written in terms of (6m ± 1) with m 2 N. Indeed, considering again as coupling process the multiplication, then the selection rules, which can be written as product of (6m ± 1) can assume the following expressions only: (6i + 1)(6j 1), (6i 1)(6j 1), (6i + 1)(6j + 1) with i; j 2 N. G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 29 3.1. Stochastic process, ‘‘zig-zagging’’ and intermittence processes: a way to define the selection rules to primality If we look at the sequence of primes x P 5 coming from A and B and compare them with the real sequence of primes we see that, with some exceptions, A and B alternate each others. For example, if we consider k = 1, . . . , 10 we obtain 6k 1 6k þ 1; k k k k ¼1 ¼2 ¼3 ¼4 5 11 17 23 7; 13; 19; 25; k k k k ¼5 ¼6 ¼7 ¼8 29 35 41 47 31; 37; 43; 49; k¼9 k ¼ 10 53 59 55; 61; where the numbers in bold are not primes. The total list of prime numbers is in the following table. The second column of this table contain the symbol ‘‘’’ if the corresponding prime candidate comes from the set A, and ‘‘+’’ if it comes from the set B: 5 7 11 þ 13 17 19 23 þ þ 29 31 37 41 43 þ þ þ 47 53 59 61 þ It seems clear that the class transition between two consecutive primes, appears to be random. Indeed, in a first approximation it can be modeled through a random walk process. There are some works about random walk and prime numbers in the literature (see, for example [34,35]). In [34], the author defined the set of random walks employing the factorization of integers into the primes. In [35], taking into account that Twins and Cousins primes seem to appear randomly and the number occurrences of them is almost the same, the author showed a random walk structure moving between the two special classes of primes. In a similar way, let us consider pA ðnÞ and pB ðnÞ (where the index * denotes subsets of A and B made of only primes) and let us move along consecutive positive integers; if we meet a prime number a 2 A, then the random walker makes the step say up and if we meet a prime number b 2 B, then the step down is performed. Let u(N) denote the displacement of the random walker after N steps, hence uðNÞ ¼ pA ðNÞ pB ðN Þ: ð3:8Þ Fig. 1 shows the behaviour of u(N). We can evaluate the mean square fluctuation f(s) about the average of the displacement that is expressed by f 2 ðsÞ ¼ hðDuðsÞÞ2 i hDuðsÞi2 ; ð3:9Þ 30 G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 Fig. 1. The plot of u(N). where Du(s) = u(s + s0) u(s0) and the average is performed over all starting points s0 in the random walk. Then, for the usual random walk f(s) = sc, where if c = 1/2 we have no long-range correlation, while for c 5 1/2 we obtain a correlation. Moreover, let us recall the Law of the Iterated Logarithm for random walk (for details see [32,33]). Let {Un:n P 0} be a random walk, then almost surely Un lim sup pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ¼ 1: n!1 2n log log n The previous result gives answers about the asymptotic smallest upper envelope of the random Walk (similar results can be also obtained for other random processes as, for example, Brownian Motion, Fractal Brownian Motion, etc). We have recalled these results to consider random processes with logarithmic law, instead of power law. Indeed, in the present work the function f(s) shows a logarithmic behaviour. Figs. 2 and 3 show the behaviour of f(s) in linear and logarithmic scale. We do not give an accurate estimate of the functional dependence, since it is not the aim of our analysis; indeed, for our purpose the logarithmic behaviour is a sufficient result to support our choice to consider random processes, with no regards to the fact that we are dealing with a long correlation or not or with a standard random walk or another stochastic process. A deep analysis of f(s) could be done in the near future. However, it could be very interesting and intriguing to obtain, in accordance with the results in [35], a f(s) proportional to the Golden Mean /, since we will have a relevant connection with some physical phenomena in Nature (see, for example, [36–41]). Moreover, the Golden Mean is also connected with the gross law of Fibonacci and Fig. 2. The plot of f(s) in linear scale. G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 31 Fig. 3. The plot of f(s) in logarithmic scale. Lucas [42], with the number of primes evaluated in correspondence with the Fibonacci numbers, and as shown in [43] the role of the Golden Mean is well known in many different fields, from Art to Science. In Fig. 4, ffiffiffi see the ratio pwe between Fn+1/Fn and p(Fn+1)/p(Fn); they show a trend to 1 + / with the Golden Mean Value / ¼ 5 1 =2. A stochastic process is also characterized by the number of returns to the origin; they happen when u(N) = 0. If we e ðN Þ the set of primes, where the number of primes p(u) coming from A* and B* is the same, that is denote U e ðN Þ ¼ fpðuÞ < N : uðpðuÞ Þ ¼ 0g; U ð3:10Þ then this can be another parameter to perform statistical analysis of the results. At this point, thanks to the preliminary results shown above in this section, we can conclude that primes could be connected with randomness. But can we find a structure in this randomness (a sort of a complex order) or are we dealing with a pure stochastic system? Suppose that the random process is composed by two sub-processes: the first is a process that produces a jump between the classes A and B (we can call it zig-zag) and a second process which switches off a number into a class for a fixed k if it is not a prime (we can call it intermittence). If the intermittence is not stochastic, then, although the final results (the stochastic process corresponding to the generation of primes) is apparently a random result, it is generated through two deterministic processes. Consequently, the inner knowledge of this process could eliminate the apparent randomness. Formally, we can write the following assertion. Assertion 1. If the process of prime generation ðX ðkÞ; k 2 N; k > 1Þ can be decomposed into two subprocesses ðZðkÞ; k 2 N; k > 1Þ and ðIðkÞ; k 2 N; k > 1Þ, where Z produces the zig-zag or the jump between A and B and I switches off the not-prime numbers, then X ðkÞ ZðkÞ IðkÞ; Fig. 4. The plots of Fn+1/Fn and p(Fn+1)/p(Fn) for the first 34 Fibonacci numbers. ð3:11Þ 32 G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 where the symbol stands for sequential alternating composition, and the process X(k) is deterministic if I(k) is deterministic. In this sense, the process I(k) plays the role of the selection rule for genetic algorithms. It is really beautiful to observe that if I(k) works on positive integer numbers coming from the set A, the following expression for the intermittence process eliminates false candidates in the final sequence. 1 ði:e: TRUEÞ if k 6¼ 6ij i þ j 8i; j 2 N; ðÞ I ðkÞ ¼ ð3:12Þ 0 ði:e: FALSEÞ if k ¼ 6ij i þ j 8i; j 2 N: Analogously, for the set B we have 1 ði:e: TRUEÞ ifk 6¼ 6ij þ i þ j or if k 6¼ 6ij i j 8i; j 2 N; ðþÞ I ðkÞ ¼ 0 ði:e: FALSEÞ ifk ¼ 6ij þ i þ j or if k ¼ 6ij i j 8i; j 2 N: ð3:13Þ Then we can write the following assertion. Assertion 2. The intermittence process assumes the form I()(k) when it acts on a number a 2 A and I(+)(k) when it acts on a number b 2 B. 3.2. Analytical formulation Thanks to the results of the previous section, we obtain the following hypothesis. Hypothesis 1. The set of prime numbers P is made of four subsets: P ¼ f2g [ f3g [ A0 [ B0 ; ð3:14Þ A0 ¼ fak 2 N : ak ¼ 6k 1 with k 2 N and k 6¼ 6ij i þ j 8i; j 2 Ng; B0 ¼ fbk 2 N : bk ¼ 6k þ 1 with k 2 N and k 6¼ 6ij þ i þ j or k 6¼ 6ij i j 8i; j 2 Ng: ð3:15Þ ð3:16Þ where Similar results can be obtained using the language of Modern Physics, that is, using the operators instead of processes, which are applied to functional states. In other words, we can use the operator of creation a+ and annihilation a applied to eigenstates for producing the eigenvalues, corresponding to prime numbers. In this case, the role of the process X(k) will be played by a Hamiltonian operator expressed in terms of the operator a+, a and a fixed potential to take into account I(k). Remark 1. For each a fixed k, the sets A 0 and B 0 produce Twins when I(k) takes the value TRUE. Remark 2. If we consider a prime a 2 A 0 for a fixed k + 1 and the corresponding b 2 B 0 obtained for k, then they will be Cousins, when I()(k + 1) and I(+)(k) take the value TRUE. Remark 3. Let us consider the sets of Twins (T) and Cousins (C) primes. These sets can be written in terms of the sets A 0 and B 0 , that is T ¼ f ðak ; bk Þ; with a 2 A0 ; b 2 B0 : k 6¼ 6ij i þ j; k 6¼ 6ij þ i þ j; k 6¼ 6ij i j 8i; j 2 N g; C ¼ f ðbk ; akþ1 Þ; with a 2 A0 ; b 2 B0 : k 6¼ 6ij i j; k 6¼ 6ij þ i þ j; k þ 1 6¼ 6ij i þ j 8i; j 2 N g: ð3:17Þ ð3:18Þ From an analytical point of view the three selection rules k 5 6ij i + j, k 5 6ij i + j, k 5 6ij i + j can be obtained as follows. Let us consider the following real functions of two real variables: z ¼ 6xy; z¼xyþk ð3:19Þ ð3:20Þ z ¼ x y þ k; z¼xþyþk ð3:21Þ ð3:22Þ with k 2 N. Fig. 5 is the plot of (3.19), while Fig. 6 shows the planes (3.20)–(3.22). G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 33 Fig. 5. The plot of (3.19). Fig. 6. The plots of the planes (3.20), (3.21), (3.22). By intersecting the function in (3.19) with the first plane3 (3.20) for x; y 2 N and x,y P 1 we obtain the useful relation for the selection rule used to realize the set A 0 , while B 0 is obtained by intersecting the function (3.19) with the planes (3.21) and (3.22) (see Figs. 7 and 8). Fig. 8 shows us that we are not dealing with real functions of two variables, but we have the following sequences: zðaÞ n : NN ! N with a = 1, 2, 3, 4 and where we can define ð3:23Þ zð1Þ n ¼ 6ij, zð2Þ n ¼ i j þ k, zð3Þ n ¼ i j þ k, zð4Þ n ¼ i þ j þ k. Therefore, by using sequences ak ¼ 6k 1; bk ¼ 6k þ 1; ð3:24Þ ð3:25Þ then starting from (3.24) and (3.25), we can build the following sub-sequences, which give us a result that is equivalent to the sets A 0 and B 0 aks ¼ 6k s 1; with k s ¼ 6 6ij i þ j; bks ¼ 6k s þ 1; with k s ¼ 6 6ij i j and k s 6¼ 6ij þ i þ j: ð3:26Þ ð3:27Þ The selection rule ks 5 6ij + i j does not give any additional contribution, since if we consider the matrices X and Y which are obtained through the expressions 6ij + i j, 6ij i + j by varying i,j 2 [1, n], then X = YT. For a fixed k, the sets A 0 and B 0 do not have the same cardinality. Indeed, if i,j 2 [1, M] we have M2 selectors for zð2Þ n , ð4Þ and M2/2 selectors for zð3Þ and z by considering the index symmetry. We have to stress that the previous estimations n n do not consider the degenerancy for which the previous estimation (i.e. M2 for both the sets A 0 and B 0 ) is reduced. 3 The plane z = x + y + k does not play any role since it gives us the same indexes to select. This appears clearly below. 34 G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 Fig. 7. A theoretical continuum model for the selection rules with k = 50 and k = 100 respectively. Fig. 8. The geometrical interpretation of the selection rules. In other words, there are different couples (i, j) which produce the same index k. Due to this reduction, that is different for A and B, we find different cardinality for A 0 and B 0 for a fixed n. The exact solutions can be reached in terms of Diophantine second degree equations. Remark 4. It is easy to note that corresponding to the selection rules on the indexes k, we can obtain the following selection rules on the numbers directly ak ¼ 6 ð6i þ 1Þð6j 1Þ ¼ 36ij 6i þ 6j 1 8i; j 2 N; bk ¼ 6 ð6i 1Þð6j 1Þ ¼ 36ij 6i 6j þ 1 and bk 6¼ ð6i þ 1Þð6j þ 1Þ ¼ 36ij þ 6i þ 6j þ 1 8i; j 2 N: ð3:28Þ ð3:29Þ In other words, the sets AðÞ ¼ fak 2 A : ak ¼ 36ij 6i þ 6j 1 8i; j 2 Ng; ð3:30Þ BðÞ ¼ fbk 2 B : bk ¼ 36ij 6i 6j þ 1 and bk ¼ 36ij þ 6i þ 6j þ 1 8i; j 2 Ng; ð3:31Þ with A() A and B() B, are the sets of candidates coming from the generation rules 6k ± 1, which are not primes. Consequently, the sets of primes coming from A and B and using the selection rules can be written as A0 ¼ A n AðÞ and B0 ¼ B n BðÞ : Here, to analyze this point deeply and to give a strategy to control the results, let us show the following strategy. Indeed, let us assume that k 2 [1, kMax] and call 6kMax + 1 = n then by following (3.7) we have to verify that pðnÞ ¼ 2 þ pA0 ðnÞ þ pB0 ðnÞ; ð3:32Þ pA0 ðnÞ ¼ pA ðnÞ=#cut-on-A ðnÞ; ð3:33Þ where with pA(n) = k = (n 1)/6 = card(A) and #cut-on-A(n) unknown function. Consequently, we obtain G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 pA0 ðnÞ ¼ n1 ¼ cardðA0 Þ: 6 #cut-on-A ðnÞ 35 ð3:34Þ Analogously, by taking into account that pB(n) = k = (n 1)/6 = card(B) we obtain n1 ¼ cardðB0 Þ: pB0 ðnÞ ¼ 6 #cut-on-B ðnÞ Then, using (3.32), (3.34), and (3.35) the p(n) assumes the following form: n 1 #cut-on-A ðnÞ þ #cut-on-B ðnÞ : pðnÞ ¼ 2 þ 6 #cut-on-A ðnÞ #cut-on-B ðnÞ Taking into account p(n) = n/log(n), the unknown function becomes #cut-on-A ðnÞ þ #cut-on-B ðnÞ n 6 2 : ¼ #cut ðnÞ ¼ #cut-on-A ðnÞ #cut-on-B ðnÞ logðnÞ n1 ð3:35Þ ð3:36Þ ð3:37Þ The result in (3.37) can be compared with the numerical one by obtaining a full agreement4 Moreover, it is easy to prove that lim n!1 #cut ðnÞ ¼ lim n!1 fðnÞ 6 2 n1 n logðnÞ n logðnÞ #cut ðnÞ ¼ lim lim n!1 pA ðnÞ þ pB ðnÞ n!1 lim n!1 #cut ðnÞ ¼ lim p ðnÞ þ pB0 ðnÞ n!1 A0 ¼ lim n!1 n logðnÞ 6 2 n1 ðn 1Þ=3 1 6n 12 lnðnÞ ¼ 0; n n1 ¼ lim n!1 18 n 2 lnðnÞ ¼ 0; lnðnÞ ðn 1Þ2 #cut ðnÞ 6 ¼ 0; ¼ lim n!1 n1 #cut ðnÞ n1 6 while as obvious we obtain that pA ðnÞ þ pB ðnÞ ðn 1Þ=3 ¼ 1; lim ¼ lim n n!1 n!1 fðnÞ logðnÞ n 2 logðnÞ pA0 ðnÞ þ pB0 ðnÞ ¼ 1: lim ¼ lim n n!1 n!1 fðnÞ logðnÞ Precisely, #cut(n)%1 slower than pðnÞ; pA ðnÞ þ pB ðnÞ; pA0 ðnÞ þ pB0 ðnÞ, while [pA(n) + pB(n)] % 1 faster than p(n) and ½pA0 ðnÞ þ pB0 ðnÞ % 1 as fast as p(n). 3.3. Primes coming from well-known classes It is trivial to prove and also very interesting to stress that some special prime numbers – such as Mersenne, Fermat, Crandall, IKE-MODP, Solinas, Wagstaff, and Baillie numbers – can be obtained from A 0 and B 0 . • MERSENNE numbers A Marsenne number is any number of the form x = 2m 1 with m-prime, that is m 2 P N. For the set of Mersenne numbers M, we have ð3:38Þ M f3g ¼ B0M B0 ; where B0M ¼ 2m1 1 b 2 B0 : k ¼ with m P 3; m 2 P N : 3 4 Here the term ‘full agreement’ means that if we call #meas(n) the measured number of primes smaller then n or equal to and n then pðnÞ ¼ logðnÞ 6kX Max þ1 n¼1 Max þ1 ðpðnÞ #meas ðnÞÞ2 6kX ðpðnÞ 2 pA0 ðnÞ pB0 ðnÞÞ2 ’ : 6k Max þ 1 6k Max þ 1 n¼1 36 G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 • FERMAT numbers A Fermat number can be written as x = 2m + 1 with m = 2k being k 2 N. For the set of Fermat numbers F, we obtain F ¼ A0F A0 ; where ( A0F ¼ ð3:39Þ ) þ1 with s 2 N : 3 s1 a 2 A0 : k ¼ 22 • CRANDALL numbers Also Crandall proposed a new form of primes, namely x = 2d c, where c is a relative small odd number, e.g. no longer than the length of a computer word (16–64 bits) [44]. For the set of Crandall numbers C, we have C f3g ¼ A0C [ B0C A0 [ B0 ; where A0C ¼ 2d c þ 1 with d 2 N and c small odd number a 2 A0 : k ¼ 6 B0C ¼ 2d c 1 with d 2 N and c small odd number : b 2 B0 : k ¼ 6 and • IKE-MODP numbers These numbers have the special form x = 2n 2m + r2k 1, k < m < n, r an integer with 0 6 r 6 2mk [45]. For the set of the IKE-MODP numbers IM, we have IM f3g ¼ A0IM [ B0IM A0 [ B0 ; where A0IM ¼ and B0IM 2n1 2m1 þ r2s1 with k < m < n; 0 6 r < 2m k a 2 A0 : k ¼ 3 2n1 2m1 þ r2s1 1 0 with k < m < n; 0 6 r < 2m k ; ¼ b2B :k¼ 3 • SOLINAS numbers The Solinas numbers are generalizations of Mersenne numbers. Indeed, they have the form x ¼ 2n þ 3 2m3 þ 2 2m2 þ 1 2m1 þ 0 , where i 2 {1, 1}, mi 0mod s with s being the length of the computer word, e.g. s = 32, 0 6 i 6 3 and also n 0mod s [19]. For the set of Solinas numbers S, we have S f3g ¼ A0S [ B0S A0 [ B0 ; where A0S ¼ 2n1 þ 3 2m3 1 þ 2 2m2 1 þ 1 2m1 1 þ 0 20 þ 21 with i 2 f1; 1g; a 2 A0 : k ¼ 3 mi 0 mod s with s being the length of the computer word; i ¼ 0; 1; 2; 3; n 0 mod s and B0S ¼ 2n1 þ 3 2m3 1 þ 2 2m2 1 þ 1 2m1 1 þ 0 20 21 with i 2 f1; 1g; b 2 B0 : k ¼ 3 mi 0 mod s with s being the length of the computer word i ¼ 0; 1; 2; 3; n 0 mod s : • WAGSTAFF numbers p A Wagstaff number has the form x ¼ 2 3þ1 with p-prime [18]. For the set of Wagstaff numbers W, we obtain: W f3g ¼ A0W [ B0W A0 [ B0 ; G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 where A0W ¼ 2p1 þ 2 a 2 A0 : k ¼ with p 2 P N 32 B0W ¼ 2p1 20 b 2 B0 : k ¼ with p 2 P N : 32 and 37 • BAILLIE numbers This set of numbers has the form x = s2n + 1 with n > 0 and small s [46]. For the set of Baillie numbers BA, we have BA f3g ¼ A0BA [ B0BA A0 [ B0 ; where A0BA ¼ s2n1 þ 1 with n 2 N and small s a 2 A0 : k ¼ 3 B0BA ¼ s2n1 with n 2 N and small s : b 2 B0 : k ¼ 3 and 4. The proof of Hypothesis 1 on primes distribution and the role of the first perfect number Let us consider the following sets of positive integers ONE ¼ fok ¼ 6k 5 : k 2 Ng; TWO ¼ ftk ¼ 6k 4 : k 2 Ng; THREE ¼ frk ¼ 6k 3 : k 2 Ng; FOUR ¼ ffk ¼ 6k 2 : k 2 Ng; A ¼ fak ¼ 6k 1 : k 2 Ng; SIX ¼ fsk ¼ 6k : k 2 Ng; B ¼ fbk ¼ 6k þ 1 : k 2 Ng: ð4:1Þ ð4:2Þ ð4:3Þ ð4:4Þ ð4:5Þ ð4:6Þ ð4:7Þ Then for construction N ¼ f1g [ TWO [ THREE [ FOUR [ A [ SIX [ B: ð4:8Þ Indeed, ONE has the same elements of B with the exception of the first element, that is 1. The following table shows the first values of the previous sets. 6k 4 2 8 14 20 26 32 38 44 50 56 62 68 74 80 86 92 98 104 110 ... 6k 3 3 9 15 21 27 33 39 45 51 57 63 69 75 81 87 93 99 105 111 ... 6k 2 4 10 16 22 28 34 40 46 52 58 64 70 76 82 88 94 100 106 112 ... A 5 11 17 23 29 35 41 47 53 59 65 71 77 83 89 95 101 107 113 ... 6k 6 12 18 24 30 36 42 48 54 60 66 72 78 84 90 96 102 108 114 ... B 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 97 103 109 115 ... 38 G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 Remark 5. It trivial to note that for construction only the sets A and B among the others can be made of primes (with the exception of the numbers 2 2 TWO and 3 2 THREE). Indeed, the sets TWO, FOUR, SIX contain the positive even integer numbers, the set THREE is made of the odd multiple integers of 3. As shown in the previous Sections unfortunately, A and B also contain not-primes numbers such as the positive integers, which are multiple of 5, and so on. Consequently, we introduced the selection rules for obtaining Hypothesis 1. Now let us prove it. Lemma 1 (On the selection rule). The positive integer numbers ak 2 A() are not primes. Proof. By multiplying ak 2 A to bk 2 B we obtain akij ¼ ð6i þ 1Þð6j 1Þ ¼ 36ij 6i þ 6j 1 ¼¼ 6ð6ij i þ jÞ 1 By choosing (6ij + i j) = k we see that (6i 1)(6j + 1) = 6k 1 2 A. Consequently, the product akbk with ak 2 A and bk 2 B gives akij 2 A. This means that we can obtain the numbers ak 2 A which are not primes, since they can be written as a product of two numbers. Then the primes ak 2 A must be different from ak ij . h Lemma 2 (On the selection rule). The positive integer numbers bk 2 B() are not primes. Proof. By multiplying two elements of B, that is bk, bk* 2 B, we obtain bkij ¼ ð6i þ 1Þð6j þ 1Þ ¼ 36ij þ 6i þ 6j þ 1 ¼¼ 6ð6ij þ i þ jÞ þ 1 By choosing (6ij + i + j) = k we see that (6i + 1)(6j + 1) = 6k + 1 2 B. Consequently, the product bkbk* with b ,b k k* 2 B gives bk ij 2 B. This means that we can obtain the numbers bk 2 B which are not primes, since they can be written as a product of two numbers. Then the primes bk 2 B must be different from bk ij . Equivalently, multiplying two elements of A, that is ak, ak* 2 A, we obtain bkij ¼ ð6i 1Þð6j 1Þ ¼ 36ij 6i 6j þ 1 ¼ 6ð6ij i jÞ þ 1: Remark 6. The previous two Lemmas show that the numbers ak 2 A and bk 2 B, which are not primes, are composite and then ak ij 2 AðÞ and bk ij 2 B(). Lemma 3 (On the selection rule). The akij 2 A can only be written in terms of the product akbk*. Proof. From Lemma 2, it follows that the product of akk* = akak* 2 B (with ak,ak* 2 A). Moreover, the product of two elements of the set TWO or FOUR or SIX is an even number. The product of two elements of the set THREE is an odd number which is multiple of 3, that is an elements of the set THREE. The product of an element of the set THREE to an element of the set TWO or FOUR or SIX is an even number. The product of an ak 2 A to an element of the set TWO or FOUR or SIX is an even number, and also multiplying an ak 2 A to an element of the set THREE we obtain an element of the set THREE. By multiplying two elements of B we obtain an element of B. Similarly, by multiplying bk 2 B to an element of the sets TWO, FOUR, SIX we obtain an even number, while multiplying bk 2 B to an element of the set THREE we obtain an element of THREE again. Consequently, we obtain that an ak 2 A can be written only in terms of the product akbk*. h Lemma 4 (On the selection rule). The bkij 2 B can only be written in terms of the products akak*, bkbk*. Proof. Using the results of Lemma 1 and going ahead similarly to Lemma 3 the result is obtained trivially. h Theorem (Theorem on the selection rule). The positive integer numbers ak 2 A, bk 2 B are not primes if and only if ak 2 A(), bk 2 B(). Proof. The proof of the theorem follows automatically from the previous four Lemmas. h Consequently, from (4.8), Remarks 5 and 6 and the previous theorem on the selection rules, Hypothesis 1 is proved. G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 39 5. Towards an optimized computational procedure for generating primes kþx 8x 2 N, it needs k + x P 6x + 1, that is If we write the equation 6xy x + y k = 0 in the form y ¼ 6xþ1 k1 ; x 6 xA ¼ 5 kþx to obtain y 2 N, where the operator dre rounds r to the next highest integer. Similarly, we have from y ¼ 6x1 8x 2 N, the condition kþ1 x 6 xB1 ¼ 5 kx and from y ¼ 6xþ1 8x 2 N, the condition k1 : x 6 xB2 ¼ 7 To obtain the primes smaller than n or equal to n, we evaluate the maximum index kmax = n/6 and enumerate the candidates according to the sets A and B. Moreover, we consider two indexes i and j such that i = 0, 1, . . . , imax and j = 0, 1, . . . , jmax. Then the algorithm for generating A 0 assumes the following form: k = 0; k_max = n/6; i = 0; j = 0; cp = 0; fp = 0; i_max = j_max = dk_max/5e; while k 6 k_max pc = 6 * k 1; while j 6 j_max while i 6 i_max fp = 35 + 42 * j + (30 + 36*j) * i; select from [pc]: pc 5 [fp] This algorithm gives us the array of primes [p], which are in A but not A(). Similarly, we can obtain the set B 0 of primes coming from the set B by recasting i_max and j_max according to xB1 and xB2, and by deleting the false candidates, fp, coming from B(). Indeed, instead of using the relation fp = 35 + 42j + (30 + 36j)i we will use the following two expressions: fp ¼ 25 þ 30j þ ð30 þ 36jÞi; fp ¼ 49 þ 42j þ ð42 þ 36jÞi: It is trivial to prove that following the transformation i = x 1, j = y 1, the previous three expressions become fp ¼ ð6x þ 1Þð6y 1Þ ¼ 36xy 6x þ 6y 1; fp ¼ ð6x 1Þð6y 1Þ ¼ 36xy 6x 6y þ 1; fp ¼ ð6x þ 1Þð6y þ 1Þ ¼ 36xy þ 6x þ 6y þ 1: Remark 5. Instead of working on the numbers directly, we can also work on the indexes (i.e. the pointers) using the following three rules: fpk ¼ 6 þ 7j þ ð5 þ 6jÞi; fpk ¼ 4 þ 5j þ ð5 þ 6jÞi; fpk ¼ 8 þ 7j þ ð7 þ 6jÞi; which become 40 G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 fpk ¼ 6xy x þ y; fpk ¼ 6xy x y; fpk ¼ 6xy þ x þ y; for i ¼ x 1; j ¼ y 1: Remark 6. Remembering the symmetries of the selection rules for the set B, the index i can run from j to i_max, instead of running from 0 to i_max. The computational load can be evaluated as follows. For a fixed kmax = n/6, we must perform 2kmax sums and 2kmax multiplications to generate A and B. Let us assume that each elementary operation has the same computational cost: this is the case of the CISC processor. Then, we have 2 Opgen ðnÞ ¼ n: 3 If we fix xmax and ymax according to the previous relations, we have xmax’ ymax ’ dkmax/5e. For each cycle and for each selection rule, we make three sums and three multiplications, that is six operations, then Opsel ðnÞ ¼ n2 : 2 In conclusion, we have the total number of operations, that is OpTOT ðnÞ ¼ Opgen ðnÞ þ Opsel ðnÞ þ 1 ¼ n2 2 þ n þ 1; 2 3 where the addition of one is due to the estimation of xmax and ymax. The previous not-optimized value can be compared with Opstandard ¼ n X x¼2 x ; logðxÞ that is the standard computational cost for generating the set of primes smaller than n or equal to n. Using RISC processor the computational cost of the addition is smaller than the cost of the multiplication. Hence, our algorithm becomes more interesting than the others. 6. Conclusion We verified the previous results for n < 107 with n 2 N numerically; that is we considered the first 664,579 primes, and we obtained no failure. Roughly, this means that for n > 107 the traditional probability that a candidate of the sets A 0 and B 0 is not a prime is of the order 1.5 · 106. In terms of genetic strategies, our results are an absolute optimum, this means that the probability to find a prime at the right location and order is equal to 1. Naturally however, the previous computational test is just a first attempt; indeed we proved Hypothesis 1 about the primality for supporting these results in Section 4. In conclusion the sets obtained thanks to 6k ± 1 k 2 N, with their selection rules, that is • A0 ¼ fak 2 N : ak ¼ 6k 1 with k 2 N and k 6¼ 6ij i þ j 8i; j 2 Ng and • B0 ¼ fbk 2 N : bk ¼ 6k þ 1 with k 2 N and k 6¼ 6ij þ i þ j 8i; j 2 N or k 6¼ 6ij i j 8i; j 2 Ng together with {2} and {3} give us the full primes set Pn, that is P n ¼ f2g [ f3g [ A0n [ B0n : Moreover, the number of primes smaller then n is pðnÞ ¼ 2 þ pA0 ðnÞ þ pB0 ðnÞ according to the Gauss p function. G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 41 For the first time, thanks to the discovery of the sets A 0 and B 0 , we have obtained an expression of the full set Pn of prime numbers smaller than n or equal to n.5 Acknowledgements The author wishes to thank Prof. Mohamed El Naschie, who introduced him to the relevance of dynamical processes in Nature and E-Infinity Theory and Prof. Saverio Salerno, who stimulated him to investigate primes. Moreover, the author is deeply indebted to Dr. Elmo Benedetto, who has supported and encouraged him during the last 2 years in this direction, with very fruitful conversations and analysis of preliminary results. References [1] Bombieri E. Problems of the millennium: the Riemann hypothesis. CLAY; 2000. [2] Du Sautoy M. The music of the primes. RCS Libri, Milano; 2003. [3] Connes A. Trace formula in non-commutative geometry and the zeros of the Riemann zeta function. Selecta Math (NS) 1999;5:29–106. [4] Hardy GH. Divergent series. VCH; 1949. p. 23–6 [chapter II]. [5] Montgomery HL. Distribution of the zeros of the Riemann Zeta Function. In: Proceedings of the international conference on mathematics,Vancouver, vol. I; 1974. p. 379–81. [6] Odlyzko AM. Supercomputers and the Riemann Zeta Function, Supercomputing 89: supercomputing structures and computations. In: Kartashev LP, Kartashev SI, editors. Proceedings of the 4th international conference on supercomputing. International Supercomputing Institute; 1989. p. 348–52. [7] Rudnik Z, Sarnak P. Zero of principal L-Functions and random matrix theory. Duke Math J 1996;82:269–322. [8] Selberg A. On the zeros of the zeta-function of Riemann. Der Kong Norske Vidensk Selsk Forhand 1942;15:59–62. [9] Granville A. Harald Cramér and the distribution of prime numbers. Lecture presented on 24th September 1993 at the Cramér symposium in Stockholm. [10] El Naschie MS. The Cosmic da Vinci Code for the Big Bang – a mathematical toy model. Int J Nonlinear Sci Numer Simulat 2007;82:191–4. [11] El Naschie MS. From pointillism to E-infinity electromagnetism. Chaos, Solitons & Fractals 2007;34(5):1377–81. [12] Iovane G, Giordano P. Wavelets and multiresolution analysis: nature of e(1) Cantorian spacetime. Chaos, Solitons & Fractals 2007;32:896–910. [13] Berry MV, Keating JP. The Riemann zeros and eigenvalue asymptotics. SIAM Rev 41 1999;41:236–66. [14] Berry MV. The Bakerian lecture, 1987: quantum chaology. Proc Roy Soc Lond Ser A, Math Phys Sci 1987;413(1844):183–98. [15] El Naschie MS. Exceptional Lie groups hierarchy and some fundamental high energy physics equations. Chaos, Solitons & Fractals 2008;35(1):82–4. [16] El Naschie MS. The Exceptional Lie symmetry groups hierarchy and the expected number of Higgs bosons. Chaos, Solitons & Fractals 2008;35(2):268–73. [17] El Naschie MS. The fundamental algebraic equations of the constants of nature. Chaos, Solitons & Fractals 2008;35(2):320–2. [18] Wagstaff Jr SS. Prime numbers with a fixed number of one bits or zero bits in their binary representation. Exp Math 2000;10(2):267–73. [19] Solinas JA. Generalized Mersenne numbers. Technical report CORR 99-39, Centre for Applied Cryptographic Research, University of Waterloo; 1999. [20] Chung J, Hasan A. More generalized Mersenne numbers. Report CORR 03-17, University of Waterloo; 2003. [21] Ko CM. Distribution of the units digit of primes. Chaos, Solitons & Fractals 2002;13:1295–302. [22] Angel J, Morales-Luna G. Counting prime numbers with short binary signed representation. CINVESTAV-IPN, Mexico; 2006. [23] Bonanno C, Mega MS. Toward a dynamical model for prime numbers. Chaos, Solitons & Fractals 2004;20:107–18. [24] Scafetta N, Imholt T, Roberts JA, West BJ. An intensity-expansion method to treat non-stationary time series: an application to the distance between prime numbers. Chaos, Solitons & Fractals 2003;15:15–24. [25] Iovane G, Salerno S. Stochastic self-similar processes. In: Mitropolskiy Yu A, El Naschie MS, editors. Cantorian structures and applications to dynamical systems, collection of scientific papers. Vinnytsia, Ukraine: O. Vlasiuk Publishing House; 2007, ISBN 966-2932-09-7. 5 At the present the patent procedure is under definition. Consequently, each a Computer Science procedure/algorithm, software solution or firmware/hardware solution for generating prime candidates and selection rules according to the results presented below for Public, Military/Defence and Business aims, must be defined in agreement with the author of the present paper. The solutions which are obtained from the relations shown in what follows can be used for Public, Military/Defence and Business aims exclusively in agreement with the author of the present paper. 42 [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] G. Iovane / Chaos, Solitons and Fractals 37 (2008) 23–42 Gel’fond AO. Sur les nombres qui ont des propriété s additives et multiplicatives données. Acta Arith 1967/1968;23:259–65. Bésineau J. Sur une probléme de Gel’fond relatif à la fonction’somme des chiffres’. C R Acad Sci Paris Sér A–B 1971;272:A453–6. Oliver M. Sur le développement en base g des nombres premiers. C R Acad Sci Paris Sér A–B 1971;272:A937–9. Fouvry E, Mauduit C. Somme des chiffres et nombres presque premiers. Math Ann 1996;305:571–99. Dartyge C, Mauduit C. Nombres presque premiers dont l’ ècriture en base r ne compose pas certain chiffres. J Number Theory 2000;81:270–91. Mitchell M. An introduction to genetic algorithms. MIT Press; 1998. Morters P. Fractal geometry from self-similarity to Brownian motion, based on a course taught in the Winter term 200/2001. Yor M, Revuz D. Continuous martingales and Brownian motion. Springer-Verlag; 1991. Billingsley P. Prime numbers and Brownian motion. Am Math Mon 1973;80:1099–115. Wolf M. Random walk on the prime numbers. Physica A 1998;250:335–44. El Naschie MS. A guide to the mathematics of E-Infinity Cantorian spacetime theory. Chaos, Solitons & Fractals 2005;25(5):955. El Naschie MS. Hilbert space, the number of Higgs particles and the quantum two-slit experiment. Chaos, Solitons & Fractals 2006;27(1):9–13. El Naschie MS, Hilbert D. Fock and Cantorian spaces in the quantum two-slit gedanken experiment. Chaos, Solitons & Fractals 2006;27(1):39–42. Iovane G, Laserra E, Tortoriello FS. Stochastic self-similar and fractal universe. Chaos, Solitons & Fractals 2004;20(3):415. Iovane G. Cantorian spacetime and Hilbert: part I – foundations. Chaos, Solitons & Fractals 2006;28(4):857. Iovane G. Cantorian spacetime and Hilbert space: part II – relevant consequences. Chaos, Solitons & Fractals 2006;29:11–22. Vajda S. Fibonacci and Lucas numbers and the golden section. New York: J. Wiley; 1989. Cook TA. The curves of life. London: Originally Published by Constable and Company; 1914; Reprinted by Dover Publications, New York. See also: El Naschie MS. Multidimensional Cantor-like sets ergodic behaviour. Specul Sci Technol 1992;15(2):138–42. Crandall RE. Method and apparatus for public key exchange in a cryptographic system. US patent # 5,159,632; 1992. Yie I, Lim S, Kim S, Kim D. Prime numbers of Diffie-Hellman Groups for IKE-MODP. In: IndoCrypt 2003. LNCS, vol. 2904. p. 228–34. Baillie R. New primes of the form k2n + 1. Math Comp 1979;33:1333–6.