I know I should listen to the voiceofreason on this but I was browsing the forums and saw my thread has crept back up. That got me thinking about primes again, and I think I have come up with a solid theory on factoring primes, (at least with the smaller numbers) and want to get some input on it. I was writing this down as notes to myself but I think I should share it. I hope I don't get assassinated,
. Well here it goes, enjoy!
If any number can be formed by the multiplication of prime numbers, than can the converse be true? That is to say, to find one prime number we must divide it by another prime?
The question is how we determine this prime number without trying n primes in order to arrive at the solution to the problem.
Suppose we were given two prime numbers. 17 and 19 and whose sum is 323.
Can we determine this without a successive try at division?
Lets try adding 1 number to this term to end up with 324.
What is the largest divisible term?
Well we factor out the problem.
2,2,3,3,3,3
That is 2x2x3x3x3x3 = 324
Note that we took the high end of the estimate.
Now we shall take these factors and distribute them evenly
2,3,3,3,3,2
So split down the middle, we have 2,3,3 and 3,3,2
And multiply them out
18 and 18
Now since we added 1 we will add or subtract one from each side to find the primes.
Once the primes are found we will test to see if their sum is equal to the first number.
17 and 19 = 323
Does this work for much larger prime multiplication, or primes that are different?
Well lets see.
Try 7 and 23
161
Add 1
162
Factor
2,3,3,3,3
Now we notice that the numbers are not evenly distributed which may mean that the two primes are not as close as in the previous example.
Now we have two choices
2,3,3,3,3 which will be pairs 2,3 and 3,3,3 or 2,3,3 and 3,3
We choose the first
2,3 = 6 and 3,3,3 = 27
6 is between primes 5 and 7
27 is between primes 23 and 29
We test the multiples of these 4 and we find 7 and 23 to be the correct answer equaling 161.
So the steps are simple.
1. Add numbers to the prime to make it even, and do a prime factorization of this number.
2. Group these prime factors into two groups.
3. Multiply the factors in each group to arrive at two numbers.
4. Choose a range to be tested around these numbers.
5. From this range select the closest primes.
6. Test those primes from the first and second groups and see if their multiples are the number being tested for.
7. If it does not match, return to step 2 and rearrange the factors.
8. If step 7 fails choose to subtract numbers or something.
9. Have yourself a nice cold beer.