0
$\begingroup$

What is the easiest and practical way of factoring numbers such as $62473207$ which are formed as a result of multiplication of two primes?

  • 1
    What tools do you have at your disposal?2017-01-02
  • 1
    It depends heavily on how large are your numbers are, how large the individual primes are, whatever special characteristics they may have, and/or performance characteristics that you need.2017-01-02

3 Answers 3

2

In general, this is a hard problem (cryptography is based on this after all). However, this time it's not so bad because you said it's the product of two primes. Assuming the two primes are not of different orders of magnitude, it's sensible to start looking around the square root. If you take the greatest integer not more than the square root of the number, you get $7903$. A very quick check around that number shows the factorisation should be $7901 \times 7907$.

  • 0
    Yes, clearly one such prime number should be smaller than the square root of the number we are factoring, so that helps quite a bit. Finding the other factor is then a matter of division.2017-01-02
  • 0
    @SimpleArt Yes, exactly. I'm on a phone so I couldn't expand sufficiently on my answer, but the first thing you do is to take the floor of the square root in order to limit the number of possibilities you need to consider. Thank you for the addition.2017-01-02
  • 0
    @SimpleArt Haha, no, sorry. In general, I don't remember the users that well unless they're the obvious stand-outs. :) But google is a great place to find such lists. Example: https://www.rsok.com/~jrm/first100primes.html2017-01-02
  • 0
    Ok, its of no importance, so I'll just delete my previous comment.2017-01-02
2

The simplest algorithm for factoring is to just try everything; this is known as trial division.

In the general case, the fastest algorithms are the quadratic sieve and the general number field sieve. There are introductions to both in Carl Pomerance's A Tale of Two Sieves. This requires number theory to understand, and the GNFS requires algebraic number theory.

In specific cases, where you know things about the primes that multiplied to form your number, you might be able to use a different algorithm. Many are listed on Wikipedia. In addition, if you don't need a top-of-the-line algorithm (for instance, if you're factoring smaller numbers), you can use a simpler algorithm like Pollard's rho, or even trial division for numbers like those of the magnitude you gave.

0

If your question is about computer tools, this question might not belong here. That being said, you can plug it into Wolfram Alpha.

Also a number of that size is small enough to brute force. So create a file in notepad (or the like) called factor.html and drop in



Open the file with the browser. I don't regard these two solutions as the "correct" way for a mathematician to solve the problem (which would be installing some tool like Mathematica or Pari/GP) but it is easy.