4

The factoring problem:

Factor $n=pq$ given only $n$ where $p$ and $q$ are primes and $0<p<\sqrt{n}<q<n$

I found that $$\gcd(n, \lfloor\sqrt{n}\rfloor!) = p$$

Would this be considered a solution to the factoring problem? I have only tested it for small semiprimes e.g. $21=3*7$

$$\gcd(21, \lfloor\sqrt{21}\rfloor!)=\gcd(21,24) =3$$ but see no reason why it wouldn't work for all semiprimes. I know that calculating $\lfloor\sqrt{n}\rfloor!$ for large RSA numbers would be a computational nightmare, but just want to know if this "solution" works every time the above conditions are met.

Thanks and Happy $\pi$ Day 2014!

Mathphile
  • 2,447
  • 15
  • 35

2 Answers2

2

It works, but consider that producing $\lfloor \sqrt n \rfloor !$ is no quicker than trial division of $n$ by all numbers up to $\lfloor \sqrt n \rfloor .$

Will Jagy
  • 146,052
  • ...and then taking the gcd makes the whole process require more time than trial division, correct? – zerosofthezeta Mar 14 '14 at 23:15
  • @zerosofthezeta, yes, but the more important point is that, with trial division, you get to quit once you have found a factor, if you were told ahead of time that there were exactly two prime factors. If not so informed, you still get to reduce the bound after finding a factor: you divide out by whatever factor(s) you have already found, work on what remains, which is now smaller; you never need to go above the square root of what remains. If you are interested, there are whole books on nothing but factoring techniques. – Will Jagy Mar 14 '14 at 23:31
1

The divisors of $n$ are $1$, $p$, $q$, and $n$.

Because $p\leq \lfloor\sqrt{n}\rfloor<q$, we know that $p|(\lfloor\sqrt{n}\rfloor)!$ but not $q|(\lfloor\sqrt{n}\rfloor)!$ (because $q$ is a prime and $(\lfloor\sqrt{n}\rfloor)!$ is a product of numbers smaller than $q$).

Therefore, $p$ is but $q$ and $n$ aren't divisors of $(\lfloor\sqrt{n}\rfloor)!$.

Thus, the greatest common divisor of those numbers is $p$.

JiK
  • 5,955
  • 20
  • 41