Ask Your Question
0

Is this type of nonlinear system known to factorize N ? What is the best way (computationally speaking) to solve it ?

asked 2025-06-07 09:53:43 +0200

Periodic_1_6 gravatar image

If N=8G+3 -> N=(4x+2)^2-(2y-1)^2 -> (4x+2)-(2y-1)=p && (4x+2)+(2*y-1)=q

2^i < x < 2^(i+1)

2^j < y < 2^(j+1)

the nonlinear system will have i+j+1 equations and i+j unknowns

and will be composed of the equations

sqrt(16x^2+16x+4-N)-(2*y-1) == 0

(one equation)

(N+(2y-1)^2-4)/4+1-2(2x+1) +1-(4x1+2)^2 == 0

(one equation)

((4x(h)+2)^2-4)/4+1-2(2x(h)+1) +1-(4x(h+1)+2)^2 == 0

with h from 1 to i-2

(i-2 equations)

((4x(i-1)+2)^2-4)/4+1-2(2*x(i-1)+1) +1-36 == 0

(one equation)

(N+(2y-1)^2-16(x-y)(x+y+1)-4)/4+1-2(2y+1) +1-(4y1+2)^2 == 0 (se y < x)

or

(N+(2y-1)^2-16(x-y)(x+y+1)-4)/4+1-2(2y+1) +1-(4y1+2)^2 == 0 (se y < x)

(one equation)

((4y(k)+2)^2-4)/4+1-2(2y(k)+1) +1-(4y(k+1)+2)^2 == 0

with k from 1 to j-2

(j-2 equations)

((4y(j-1)+2)^2-4)/4+1-2(2*y(j-1)+1) +1-36 == 0

(one equation)

Example N=18483 (system written in sagemath)

import time
Start_Time = time.time()
var('N x y x1 x2 x3 x4 y1 y2 y3')

eq0 = (4*35+2)^2-(2*21-1)^2 -N == 0
eq1 = sqrt(16*x^2+16*x+4-N)-(2*y-1) == 0

eq2 = (N+(2*y-1)^2-4)/4+1-2*(2*x+1) +1-(4*x1+2)^2 == 0
eq3 = ((4*x1+2)^2-4)/4+1-2*(2*x1+1) +1-(4*x2+2)^2 == 0
eq4 = ((4*x2+2)^2-4)/4+1 -2*(2*x2+1) +1-(4*x3+2)^2 == 0
eq5 = ((4*x3+2)^2-4)/4+1 -2*(2*x3+1) +1-(4*x4+2)^2 == 0
eq6 = ((4*x4+2)^2-4)/4+1-2*(2*x4+1) +1-36 == 0

eq7 = (N+(2*y-1)^2-16*(x-y)*(x+y+1)-4)/4+1-2*(2*y+1) +1-(4*y1+2)^2 == 0
eq8 = ((4*y1+2)^2-4)/4+1-2*(2*y1+1) +1-(4*y2+2)^2 == 0
eq9 = ((4*y2+2)^2-4)/4+1 -2*(2*y2+1) +1-(4*y3+2)^2 == 0
eq10 = ((4*y3+2)^2-4)/4+1-2*(2*y3+1) +1-36 == 0

solutions = solve([eq0,eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10],N,x,y,x1,x2,x3,x4,y1,y2,y3)
sol = solutions
Execution_Time = time.time() - Start_Time
print (Execution_Time)
print(sol)

Is this type of nonlinear system known to factorize N ?

What is the best way (computationally speaking) to solve it ?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2025-06-07 11:11:12 +0200

Matthias Steiner gravatar image

If You square eq1, then all your equations are multivariate quadratic polynomials, so you can compute a Gröbner basis to solve the system.

You can achieve this with the following code:

P.<N, x, y, x1, x2, x3, x4, y1, y2, y3> = PolynomialRing(QQ, order="degrevlex")

eq0 = (4*35+2)^2-(2*21-1)^2 -N
eq1 = 16*x^2+16*x+4-N-(2*y-1)^2

eq2 = (N+(2*y-1)^2-4)/4+1-2*(2*x+1) +1-(4*x1+2)^2
eq3 = ((4*x1+2)^2-4)/4+1-2*(2*x1+1) +1-(4*x2+2)^2
eq4 = ((4*x2+2)^2-4)/4+1 -2*(2*x2+1) +1-(4*x3+2)^2
eq5 = ((4*x3+2)^2-4)/4+1 -2*(2*x3+1) +1-(4*x4+2)^2
eq6 = ((4*x4+2)^2-4)/4+1-2*(2*x4+1) +1-36

eq7 = (N+(2*y-1)^2-16*(x-y)*(x+y+1)-4)/4+1-2*(2*y+1) +1-(4*y1+2)^2
eq8 = ((4*y1+2)^2-4)/4+1-2*(2*y1+1) +1-(4*y2+2)^2
eq9 = ((4*y2+2)^2-4)/4+1 -2*(2*y2+1) +1-(4*y3+2)^2
eq10 = ((4*y3+2)^2-4)/4+1-2*(2*y3+1) +1-36 

I = ideal([eq0, eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9, eq10])

gb = I.groebner_basis(algorithm="giac:gbasis", prot=True)

print(gb)
[N - 18483, x - 35, y - 21, x1 - 17, x2 + 9, x3 + 5, x4 + 3, y1 + 11, y2 - 5, y3 + 3]

For the complexity of solving the system, the example you provide consists of 9 quadratic polynomials in 10 variables. The DRL leading monomials of your input equations are:

for poly in I.gens():
    print(poly.lm())

N
x^2
y^2
x1^2
x2^2
x3^2
x4^2
x^2
y1^2
y2^2
y3^2

So your equations already contain a zero-dimensional DRL Gröbner basis, by ignoring one of the polynomials with leading monomial $x^2$. I am assuming here that this holds for the general case of $i + j + 1$ polynomials in $i + j$ variables too. You now have two options to solve the system:

  1. Ignore one polynomial and perform term order conversion to LEX. With fast linear algebra this approach has polylogarithmic complexity (assuming that some precomputations are for free + theoretical assumptions I am not going to explain here) $\tilde{\mathcal{O}} \left( 2^{\omega \cdot (i + j)} \right)$.

  2. You recompute the DRL Gröbner basis for the full system. With this and this paper the complexity of recomputing the DRL Gröbner basis is $\mathcal{O} \left( \binom{2 \cdot (i + j +1)}{i + j + 2}^\omega \right)$.

The constant $2 \leq \omega \leq 3$ is the exponent of matrix multiplication. State-of-the-art upper bound is $\omega < 2.371339$.

edit flag offensive delete link more

Comments

@Matthias Steiner so this system is not suitable for factoring large numbers?

Periodic_1_6 gravatar imagePeriodic_1_6 ( 2025-06-07 11:53:01 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2025-06-07 09:53:43 +0200

Seen: 88 times

Last updated: Jun 07