RE: pseudo idea; I'll try again!

Expand Messages
• no more posts for a while... proofreading is hectic here s how to catch a 2-pseudoprime... if `I is already prime, then the algorithm lets it slip through;
Message 1 of 1 , Feb 19, 2008

here's how to catch a 2-pseudoprime...

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

the method below is unproven, but not unfounded... and
a bit much to take in...

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
num-ber is prime!
35 IF YY= 1 AND ((Y=> I*1/8 AND Y<= I*1/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*1/8 OR (Y>= I*1/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

Bill B.

____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
Your message has been successfully submitted and would be delivered to recipients shortly.