...Beauty, cleaning, DIY tips and more - free to join!
   Login   Contact us   Site map   Puzzle Club   Ask a question    Newsletter

How To Work Out The Factors Of A Large Prime At Speed

Games : Codes And Ciphers

As usual the answer to working out the factors of a large prime number requires a leap of faith. We all know that the strongest point of a method is the place you should least consider probing.

Yet most people trying to work out the factors of a large prime will try to work out ways of speeding up factoring.

However the best way to find the factors of a large prime is not through factoring. The way is to look at the patterns present in the numbers of the product of two primes which is of length n digits, exploiting the fact that by definition the large number, call it x, is not prime. Through analysis you can find patterns that suggest the range of the factors, thus cutting down massively the range of candidate primes that you need to check.

To take a trivial example, I don't need to start hacking away at random primes to find the factors of x where x = 2,345,234,654,346,256,657,865,433,554,332,892

The fact that the number ends in '2' tells you the factors are '2' and x / 2 (if x were 10 then this would be 2 and 10/2 or 5).

This seems blindingly obvious but there are other patterns you may not know about at this trivially low level. If you have '3' as a factor, there is a property that can be exploited. Without trying to do any factoring for instance we know that 364963635496683 has a factor of 3.

In fact we work this out by summing up the digits to find y, here 81, and exploit the fact that if y divided by three is an integer (y mod three has no remainder) then three is a factor of the number.

So, if the product sums to three, ends in 0,2,4,5,6,8 then we can spot the factors without calculation.

If the number ends in 1,3,7,9 then you need some more sophisticated pattern analysis, left as an exercise to the reader.

As a hint, write a list of some significantly larger primes. Calculate the difference, known as the gap, between those primes.

Is any gap present more than twice? Does knowing the gaps between consecutive primes embue any discernible pattern on the product of consecutive primes with any other prime?


By: Fred

Share on Facebook: On Twitter: TwitterTweet this!

  Reply to How To Work Out The Factors Of A Large Prime At Speed

  Receive Our Newsletter




Questions about code book:

Ask question

More Articles:
Brainteaser 5
Kakuro Tips
How to do face painting