The Distribution of the Non-Prime Numbers - a New Sieve
Total Page:16
File Type:pdf, Size:1020Kb
Text, methods, sieve and algorithms copyright © Fabio Giraldo-Franco The distribution of the non-prime numbers - A new Sieve - FABIO GIRALDO-FRANCO and PHIL DYKE 1. Introduction The aim of this work is to show, by introducing a new sieve (©reated by Fabio Giraldo-Franco), how prime numbers and non-prime numbers are related, showing the independent patterns that exist in natural numbers and how all of them can be linked. 2. The Sieve Having found that non-prime numbers and prime numbers are nicely separated, and that non-prime numbers form infinite independent sequences or patterns, this sieve was created. The most important thing is that, even having infinitely many patterns, with infinitely many non-prime numbers in them, no number will be ever in more than one pattern. It means, that the same number will not be found twice. However, it is necessary to create a method (sieve) to link all these sequences to be able to list the non-prime numbers and the prime numbers separately. (To create any of these lists we have to establish an upper bound that leads us to work with a finitely many patterns each with a finite number of elements, but still no number will be in more than one pattern.) In this next paragraph, let us describe how the sieve works. Define a list, let’s name it LIST (this will eventually become the list of prime numbers), of natural numbers from 2 to n (the upper bound) we remove from LIST every even number, except 2 which is by definition a prime number, by using the following expression: 2*2 + 2*N where N ≥ 0 and * denotes multiplication (N is for all calculations the sequence of natural numbers starting with 0, i.e., N = {0, 1, 2, 3, 4,…}). This expression (first calculation) gives the sequence of numbers from 4 to infinity by (step) 2. Then, after removing that sequence of numbers from LIST, the original list will become: LIST = {2, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, …}. Now we use the same kind of expression used before, i.e., J*K + M*N where N ≥ 0. The values in the first calculation were: J = 2 (2 is the first term in LIST), K = 2 (2 is the first term in LIST) and M = 2 (2 is the first term in LIST). Having used, in the first calculation, the first term in LIST now we select the next one, i.e., 3 (3 is the second term in LIST). The expression now is: 3*3 + 6*N where N ≥ 0. This expression (second calculation) gives the sequence of numbers from 9 to infinity by (step) 6. All numbers in this sequence are now removed from LIST. In this case the values are: J = 3 (3 is the second term in LIST), K = 3 (3 is the second term in LIST) and M = 6 (6 is the product of 3x2, i.e., the second term in LIST multiplied by the first term in LIST). Then, having used the second term in LIST, we select the next one, i.e., 5 (5 is the third term in LIST. -Note that the number 4 was removed with the first calculation-). The expression now is: 5*5 + 30*N where N ≥ 0. This expression (third calculation) gives the sequence of numbers from 25 to infinity by (step) 30. All numbers in this sequence are now removed from LIST. In this case the values are: J = 5 (5 is the third term in LIST), K = 5 (5 is the third term in LIST) and M = 30 (30 is the product of 5x3x2, i.e., the third term in LIST multiplied by the second term in LIST multiplied by the first term in LIST). In this case it is possible to see that, for the first time, the value of M is bigger than the product of J*K, i.e., M>J*K. Given that, the new expression (fourth calculation) will use the last value of K, i.e., 5, the last value of M, i.e., 30, but for J it will use the next term in LIST, i.e., 7 (note that 6 was removed with the first calculation). Continuing, the expression now is: 7*5 + 30*N where N ≥ 0. This expression (fourth calculation) gives the sequence of numbers from 35 to infinity by (step) 30. All numbers in this sequence are now removed from LIST. In this case the values are: J = 7 (7 is the fourth term in LIST), K = 5 (5 is the third term in LIST) and M = 30 (30 is the product of 5x3x2, i.e., the third term in LIST multiplied by the second term in LIST multiplied by the first term in LIST). In this case it is possible to see that the value of M is less than the value of J*K, i.e., M<J*K. Given that, K takes the current value of J, i.e., 7. For the next calculation, the expression is: 7*7 + 210*N where N ≥ 0. This expression (fifth calculation) gives the sequence of numbers from 49 to infinity in steps of 210. All numbers in this sequence are now removed from LIST. In this case the values are: J = 7 (7 is the fourth term in LIST), K = 7 (7 is the fourth term in LIST) and M = 210 (210 is the product of 7x5x3x2, i.e., the fourth term in LIST multiplied by the third term in LIST multiplied by the second term in LIST multiplied by the first term in LIST). In this case we see that, once again, the value of M is bigger than the value of J*K, i.e., M>J*K. Given this, the new expression 11*7 + 210*N uses the same value of K as the earlier calculation, i.e., 7; also the same value of M, i.e., 210, but for J it uses the next term in LIST, i.e., 11. Hence we note that 8 and 10 were removed with the first calculation but that 9 was removed with the second calculation. Hence there is no redundancy and the sieve is efficient. By repeating this process we can find the entire list of prime numbers up to any number we want (our upper bound) simply given by LIST. The list of prime numbers will appear, obviously, in order after removing the terms generated in each calculation. The next expressions are: 11*7 + 210*N where N ≥ 0. M>J*K (Sixth calculation) 13*7 + 210*N where N ≥ 0. M>J*K (Seventh calculation) 17*7 + 210*N where N ≥ 0. M>J*K (Eighth calculation) 19*7 + 210*N where N ≥ 0. M>J*K (Ninth calculation) 23*7 + 210*N where N ≥ 0. M>J*K (Tenth calculation) 29*7 + 210*N where N ≥ 0. M>J*K (Eleventh calculation) 31*7 + 210*N where N ≥ 0. M<J*K. Note that in this calculation (Twelfth calculation) M<J*K, then the next calculation will change the values of J, K and M. 11*11 + 2310*N where N≥0. M>J*K. Here the value of M is the product of 11x7x5x3x2 (the first fifth terms in LIST multiplied together). This expression (thirteenth calculation) gives the sequence of numbers from 121 to infinity by (step) 2310. 13*11 + 2310*N where N ≥ 0. M>J*K (fourteenth calculation) 17*11 + 2310*N where N ≥ 0. M>J*K (fifteenth calculation) 19*11 + 2310*N where N ≥ 0. M>J*K (sixteenth calculation) 23*11 + 2310*N where N ≥ 0. M>J*K (seventeenth calculation) etc. We can iterate as many times as we want using the simple rules stated above. Note that: in some calculation, where J = K (having done the previous calculations) every number in LIST less than J*K is a prime. The following table shows the first 79 calculations and patterns of non-prime numbers. The second table will give some additional patterns. The relationship between patterns is evident now: it is necessary (in order to create a technique to list the prime numbers) to calculate the first expression to find the first pattern; then to remove that pattern from the original list; then, the new list gives the values for the second expression and from the second calculation we get the third expression and so on. The following table shows the first 79 calculations and patterns of non- primes. In column three, where the condition is greater than the expression (M>J*K) has been right justified. This has not been done when the condition is less than in order that these rarer conditions stand out and can be easily seen. Calcu Expression Situation Sequences to be removed from lation LIST J*K + M*N N≥0 The values of n goes to infinity if wanted 1 2*2 + 2*N M<J*K Seq (4 to n by 2) 2 3*3 + 6*N M<J*K Seq (9 to n by 6) 3 5*5 + 30*N M>J*K Seq (25 to n by 30) 4 7*5 + 30*N M<J*K Seq (35 to n by 30) 5 7*7 + 210*N M>J*K Seq (49 to n by 210) 6 11*7 + 210*N M>J*K Seq (77 to n by 210) 7 13*7 + 210*N M>J*K Seq (91 to n by 210) 8 17*7 + 210*N M>J*K Seq (119 to n by 210) 9 19*7 + 210*N M>J*K Seq (133 to n by 210) 10 23*7 + 210*N M>J*K Seq (161 to n by 210) 11 29*7 + 210*N M>J*K Seq (203 to n by 210) 12 31*7 + 210*N M<J*K Seq (217 to n by 210) 13 11*11 + 2310*N M>J*K Seq (121 to n by 2310) 14 13*11 + 2310*N M>J*K Seq (143 to n by 2310) 15 17*11 + 2310*N M>J*K Seq (187 to n by 2310) 16 19*11 + 2310*N M>J*K Seq (209 to n by 2310) 17 23*11 + 2310*N M>J*K Seq (253 to n by 2310) 18 29*11 + 2310*N M>J*K Seq (319 to n by 2310) 19 31*11 + 2310*N M>J*K Seq (341 to n by 2310) 20 37*11 + 2310*N M>J*K Seq (407 to n by 2310) 21 41*11 + 2310*N M>J*K Seq (451 to n by 2310) 22 43*11 + 2310*N M>J*K Seq (473 to n by 2310) 23 47*11 + 2310*N M>J*K Seq (517 to n by 2310) 24 53*11 + 2310*N M>J*K Seq (583 to n by 2310) 25 59*11 + 2310*N M>J*K Seq (649 to n by 2310) 26 61*11 + 2310*N M>J*K Seq (671 to n by 2310) 27 67*11 + 2310*N M>J*K Seq (737 to n by 2310) 28 71*11 + 2310*N M>J*K Seq (781 to n by 2310) 29 73*11 + 2310*N M>J*K Seq (803 to n by 2310) 30 79*11 + 2310*N M>J*K Seq (869 to n by 2310) 31 83*11 + 2310*N M>J*K Seq (913 to n by 2310) 32 89*11 + 2310*N M>J*K Seq (979 to n by 2310) 33 97*11 + 2310*N M>J*K Seq (1067 to n by 2310) Calcu Expression Situation Sequences to be removed from lation LIST 34 101*11 + 2310*N M>J*K Seq (1111 to n by 2310) 35 103*11 + 2310*N M>J*K Seq (1133 to n by 2310) 36 107*11 + 2310*N M>J*K Seq (1177 to n by 2310) 37 109*11 + 2310*N M>J*K Seq (1199 to n by 2310) 38 113*11 + 2310*N M>J*K Seq (1243 to n by 2310) 39 127*11 + 2310*N M>J*K Seq (1397 to n by 2310) 40 131*11 + 2310*N