Computational complexity of random recursive integer factoring algorithm
asked 8 hours ago by @qa-rsuwii9cfc37rauhdkff 0 rep · 38 views
random rsa complexity theory fractals factorization
I am studying the probabilities PN to find p and q at the j level of the recursion.
I have done many trials to implment the central idea to represent N = x² + bx + c . Solving this quadratic means look for the several values of the random variable x. that satisfy a set of condition in delta and the factors on N . As I could understand and prove c < sqrt(N) .
If delta is a perfect square then b and sqrt(delta ) share their parity and give x_1 and x_2 integers. the probability to extract x such that delta(x) is a perfect square is the point of my question . thank you
Function Factorize(N):
// Base case: small N
If N <= 3:
Return N
// 1. Select x in the range [1, floor(sqrt(N))]
x = RandomInteger(1, floor(sqrt(N)))
// 2. Compute coefficients based on N = x^2 + bx + c
// b = floor((N - x^2) / x)
// c = N - x^2 - (b * x)
b = floor((N - x^2) / x)
c = N - x^2 - (b * x)
// 3. Solve the quadratic congruence delta = b^2 - 4c
delta = b^2 - (4 * c)
// 4. If delta is a perfect square, attempt to extract factors
If delta >= 0 AND IsPerfectSquare(delta):
sqrt_delta = sqrt(delta)
x1 = (-b - sqrt_delta) / 2
x2 = (-b + sqrt_delta) / 2
p = x + abs(x1)
q = x + abs(x2)
If (p * q) == N:
Return (p, q)
// 5. Recursive step: descend into the residue c
Return Factorize(c)