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

RE: it works! wasn't thought out

Expand Messages
  • leavemsg1
    here s how to catch a 2-pseudoprime... off the cuff... if `I is already prime, then the algorithm lets it slip through; but... if `I is a pseudo-prime, then
    Message 1 of 1 , Feb 18, 2008
    • 0 Attachment
      here's how to catch a 2-pseudoprime... off the cuff...

      if `I' is already prime, then the algorithm lets it slip through;
      but...
      if `I' is a pseudo-prime, then it catches it before saying it's prime!

      is my idea creative enough ??? can someone verify it ???
      my computer is very, very primitive

      Mr./Dr. Kosinar... give it a try now, reluctantly, or otherwise.

      the method below is unproven, but not unfounded... and a bit much to
      take in... I'd even take a comment from the fatphil Carmody, if he's
      still in the Group

      10 CLS
      15 FOR I= 7 TO 2001
      20 IF 2^(I-1) MOD I= 1 THEN //the usual 2-PRP test
      25 Y= 2^(((I-1)/2)-3) MOD I
      30 YY= I MOD 4
      32 // check for pseudoprime before saying the number is prime!
      35 IF YY= 1 AND ((Y> I/8 AND Y< I/2) OR (Y> I*3/4 AND Y< I*7/8))
      THEN
      40 PRINT I, "composite"
      45 END IF
      50 IF YY= 3 AND (Y< I/8 OR (Y> I/2 AND Y< I*3/4) OR Y> I*7/8) THEN
      55 PRINT I, "composite"
      60 ELSE PRINT I, "prime"
      65 END IF
      70 SLEEP 1
      75 END IF
      80 NEXT I
    Your message has been successfully submitted and would be delivered to recipients shortly.