1st : At start, we have nothing. So we have a list of zero element. More accurately, zero floating point element.
2nd : we catch a rule. As lots of objects, long objects (10cm, 4 inches, or other...), this rule has a starting point (1st element), and a finishing point (2nd element). So we add two (=2) elements in our empty list. we have 0.0 (starting point) and 1.0 (finishing point).
3rd : now, we will divide this rule. And because I am not clever, I choose the simplest division : on two (2). This adds a 3rd list element : 0.5. Conclusion : we had 2 list elements before, and now, we get 3 list elements ! From 2 to 3 !
4th : I want to insert more accurate values : no problem, I will divide my rule by three (3). I have so :
0/3 already recorded in the first step
1/3 new value
2/3 new value
3/3 already recorded in the first step
If I "ForEach" my list to display it, I also have :
Code: Select all
0.0
0.33333...
0.5
0.66666...
1.0
5th : Already, 2, then 3, then 5 : I feel like a genius. This seems like the primes numbers serial !!! Let's continue to check : let's divide by 4 to discover...
0.0 already found
0.25 new value
0.3333 already found
0.5 already found
0.6666 already found
0.75 new value
1.0 already found
Two new value : our list had 5 elements, and now it gets 7 !!
2, 3, 5, and 7 : sure God chose me !
6th : let's add the division by 5 now...
Let's see the list...
0.0 already
0.2 new
0.25 already
0.33333 already
0.4 new
0.5 already
0.6 new
0.6666 already
0.75 already
0.8 new
1.0 already
As you can see, the list of the prophet what I am, four (4) values are adding themselves. And we pass from a list of 7 elements to a list of 11 elements...
Conclusion : 2, 3, 5, 7 and 11. Which value has the Nobel price I will receive ? Only prime numbers, only neighbour prime numbers !
7th : After dividing by 5, let's divide by 6, all simply !
0.0 already
0.16667 new
0.2 already
0.25 already
0.33333 already
0.4 already
0.5 already
0.6 already
0.6666 already
0.75 already
0.8 already
0.833333 new
1.0 already
As forseen, 2 new values and a list size which passes from 11 elements to 13 elements.
Conclusion : 2, 3, 5, 7, 11 and 13. I am entered in the mathematical religion as da* in mu*. That will be my public thanks sentence. I say it to you, and let us go the next step...
8th : division by 7... burp... There, my magic algo forgets '17' is a prime number ! I am crazy... All is false... Everything, the whole world falls to myself... And the nobel price goes away !
Impressive catch where the 6 first prime numbers appear perfectly but stop on the 7th prime number : 17. As if it existed a world where x/7 had only 4 new values, and 2 other values might not be recorded in this list, but in an other new list.
I tested a general algo, and, forgeting the floating point precision, this goes not, following the prime numbers serial, and bypassing it also, until reaching composite numbers (ex : 33)...
So, if you get a question to complete a numbers serial :
Code: Select all
2, 3, 5, 7, 11, 13, ...
OEIS A005728