Use a pairing function for prime factorization

91 Views Asked by At

Let $n$ be the product of the two unknown primes $a$ and $b$ ($a < b$):

$ab = n$

My idea was to use a pairing function so:

$a = f(p)$ and $b = g(p)$

Then the equation is:

$f(p) \cdot g(p) = n$

My idea was that now there is only one unknown variable $p$, the equation is easier to solve. I used Matthew Szudzik's pairing function and got this:

$(p - \lfloor\sqrt{p}\rfloor^2)\cdot\lfloor\sqrt{p}\rfloor = n$

When $p$ was found it would be easy to calculate $a$ and $b$.

But I don't know how to solve this equation.

Do you think it's a good idea or is there no benefit at all?