Loading ...
Sorry, an error occurred while loading the content.
 

Re: [PrimeNumbers] Explicit calculation of prime positive integers

Expand Messages
  • Yann Guidon
    Hi ! ... hmmmm it looks like... some sort of folded sieve, it reminds me of stack-based algorithms, and your vector is a bit like a stack... quite clever :-) a
    Message 1 of 2 , Aug 2 5:01 PM
      Hi !

      Kermit Rose wrote:
      > Kermit says:
      > One could construct the following vector sequence that would make clear
      > what it is that makes a prime a prime.
      >
      > To make the next entry,
      > Just add 1 to each number in the vector.
      >
      > Each time you cross a prime, you add another entry for that prime.
      >
      > Each time you reach 2 in the 2's place, start over, so that the next
      > entry in the 2's place is a 1.
      > Each time you reach 3 in the 3's place, start over so that the next
      > entry in the 3's place is a 1.
      > etc
      hmmmm it looks like... some sort of folded sieve,
      it reminds me of stack-based algorithms,
      and your vector is a bit like a stack... quite clever :-)
      a stack of counter in fact...
      but this method needs to scan all numbers.
      it does not jump from one prime number to the other :-/

      > 2 = [2] First prime.
      > 3 = [1] Prime because 2 is not in the 2's place.
      > 4 = [2,1] Not prime because in the 2's place is a 2.
      > 5 = [1,2] Prime because in the 2's place is not a 2, and in the 3's
      > place is not a 3.
      > 6 = [2,3,1] Not prime because in the 2's place is a 2. Also not prime
      > because in the 3's place is a 3.
      > 7 = [1,1,2] Prime because in the 2's place is not a 2, and in the 3's
      > place is not a 3, and in the 5's place is not a 5.
      <snip>
      > etc
      I'll think carefully about the method you show.
      does it have a name, where is it used, how can it be found or referenced ?

      > Kermit says:
      > Yann, in order to answer your question, we need to know details of your
      > method.
      I have just put some example code online at http://ygdes.com/sources/premiers.html
      The algo is in JavaScript inside the page (very handy).
      I'm not (yet ?) used to the tools that many contributors here use
      (pari ?), it could change when I get a better idea about it.

      The algorithm is explained in an article that will soon be published.
      The original is there : http://ygdes.com/sources/misc-prems.html
      (sorry, french only). It's a newcomer-level article but some
      interesting stuff is at the end.

      > Kermit says:
      > Hmmmm...... Why versus how.
      > I think that maybe I have never understood the meaning of "why?".
      > For me, answering how things happen does answer all my questions.
      > I myself see no difference in meaning for "why?" and "how?".
      maybe my "why" is the "how" of the "how" ?

      anyway i'm too tired to dissert about it now.

      thank you very much for your insight,
      > Kermit Rose
      yg
    Your message has been successfully submitted and would be delivered to recipients shortly.