[Math] the running time of this algorithm of prime factorization

computational complexitynumber theoryprime factorizationreference-request

I recently figured out my own algorithm to factorize a number given we know it has $2$ distinct prime factors. Let:

$$ ab = c$$

Where, $a<b$

Then it isn't difficult to show that:

$$ \frac{c!}{c^a}= \text{integer}$$

In fact,

$$ \frac{c!}{c^{a+1}} \neq \text{integer}$$

So the idea is to first asymptotically calculate $c!$ and then keep dividing by $c$ until one does not get an integer anymore.

Edit

I just realized a better algorithm would be to first divide $c^{\lfloor \sqrt {c} /2\rfloor }$. If it is not an integer then divide by $c^{\lfloor \sqrt {c} /4\rfloor }$. However is it is an integer then divide by: $c^{3\lfloor \sqrt {c} /4 \rfloor }$ . And so on …

Question

I was wondering if this already existed in the literature? And what is the running time of this algorithm? Can this algorithm be improved upon?

Best Answer

The best factoring algorithm currently available is the General Number Field Sieve. Numbers of more than 200 decimal digits have been factored using this method.

The factorial of such a number would have more than $10^{200}$ digits $-$ where on earth are you going to put them all? And that's even before you start your trial divisions. I'm afraid your method is completely impractical as a factoring algorithm.

Related Question