Sorry, an error occurred while loading the content.
Browse Groups

• Hey Group, I am coming to you with a recent discovery that I have stumbled upon and I am looking to you for help. I am not sure if this is something that has
Message 1 of 1 , Nov 20, 2003
View Source
Hey Group,

I am coming to you with a recent discovery that I have stumbled upon and I am looking to you for help. I am not sure if this is something that has been discovered but I have not found any indication of it yet in my research. What I have found is a way to find prime numbers for a range of numbers whose calculation time greatly decreases the closer you get to the top of your range using only multiplication. Forgive me for not describing this the mathematically correct way, I am a Computer Scientist turned Tech Manager :-)

I would really really really appreciate some feedback. I am interested in everything, whether this has been approached before, how to possibly word this more correctly so it can be stated mathematically. This group is an excellent forum and I hope that if nothing else this helps with the discussions on some level.

What it is in a Nutshell!!!

Basically when 3 is multiplied against a number in a particular set and rounded to the next whole number it will result in the next prime number. The difficult part to explain is how to define the set.

DEFINING THE SET (HERE GOES THE FUN PART)!

The numbers in the set are any whole number >= 1 and < the selected range we are searching, that is added to 1/3 if it is even and 2/3 if it is odd and then multiplied by three to get the next prime number.

For example:
1 + 2/3 (3) = 1.6666666666666666666666666666667 (3) = 5
2 + 1/3 (3) = 2.3333333333333333333333333333333 (3) = 7

We will call this number P.

Once you have P you then will follow the same process again which is to multiply P against all whole numbers in your range where 1 >= x <= top of range where the even numbers are added to 1/3 and the odd numbers to 2/3.

So carrying the example forward and using the first P in our list which is 5:
1 + 2/3 (5) = 1.6666666666666666666666666666667 (5) = 8.3333333333333333333333333333333

2 + 1/3 (5) = 2.3333333333333333333333333333333 (5) = 11.666666666666666666666666666667

We will call this number E for (Exceptions). What P describes to us is a number that is prime and what E does is subtracts numbers from the set that we are multiplying against 3 to get the next prime number. If you multiply three against one of the exceptions it will result in non-prime number.

So procedure would be to repeat the following two steps until you reach the end of your range:

1. Multiply first number in set A that is not in exception set B against 3 to get the first Prime Number.
2. Multiply the first Prime Number against the all numbers in set to get a subset of exceptions for set B.

Here is some Perl Code that I have written that will calculate the primes up to a given number. I have used this code to prove all prime numbers up to a billion to prove the hypothesis.

Whatever is easier for you to view, I have attached the perl script to this e-mail and I am also pasting it below. If that fails you can view it at http://www.anaviet.com/mike/prime.html

\$max defines the top of the range so if you change this to 1000 it will find all prime numbers up to and including the first one over 1000. So if you wanted to give it a run on your machine to see for yourself.

Warmest Regards,
Michael A. Garcia

use Bit::Vector;#DEFINE CONSTANT VALUESmy \$EVEN = 1/3; #Value to be added to all EVEN whole numbers before multiplied by 3.my \$ODD = 2/3; #Value to be added to all ODD whole numbers before multiplied by 3.#BRING THE RESTmy \$file = \$ARGV[0] eq "" ? "primes.out" : \$ARGV[0];my \$tm = time();my \$max = 10000000; #Top Range to calculate prime numbers to.my \$exclude = new Bit::Vector(\$max+1); #Compensate for the fact of not using zero index by adding 1.open(OUTPUT, ">\$file");print OUTPUT "2\n3\n"; #Prime Numbers Below or equal to three.for(my \$num = 1, my \$intv = 0; \$intv <= \$max; \$num++) { next if(\$exclude->bit_test(\$num)); #Excluded number if when run will result in a non-prime number. \$intv = num_evaluate(\$num, 3, "round"); for(my \$i = 1, my \$t = 0 ; \$t <= \$max; \$i++) { \$t = num_evaluate(\$i, \$intv, "int");
\$exclude->bit_flip(\$t) unless(\$t >= \$max || \$exclude->bit_test(\$t)); } print OUTPUT "\$intv\n";# print "\$intv ";}close(OUTPUT);print "\nTotal Time for processing : ", time() - \$tm, " in seconds.\n";###### Takes a whole integer and adds the appropriate decimal extension to it so it can be multiplied by term.# Decimal extension is the natural tendency for a whole number to find the next prime number when multiplied by term.#####sub num_evaluate(\$) { my (\$num, \$term, \$perform) = @_; #Read in Arguments. my \$note = \$num % 2 == 0 ? \$EVEN : \$ODD;#Based on the modulous we know what to assign even or odd numbers. my \$val = \$num + \$note; #Add decimal ending to the number being evaluated. my \$t = \$val * \$term; #Multiply number by three. if(\$perform eq "round") { return sprintf("%.0f", "\$t"); #Round
number to the nearest whole number. } elsif(\$perform eq "int") { return int(\$t); #Force to int so it will always round down. } else { return 0; }};__END__

---------------------------------
Do you Yahoo!?
Free Pop-Up Blocker - Get it now

[Non-text portions of this message have been removed]
Your message has been successfully submitted and would be delivered to recipients shortly.
• Changes have not been saved
Press OK to abandon changes or Cancel to continue editing
• Your browser is not supported
Kindly note that Groups does not support 7.0 or earlier versions of Internet Explorer. We recommend upgrading to the latest Internet Explorer, Google Chrome, or Firefox. If you are using IE 9 or later, make sure you turn off Compatibility View.