Uniqueness of an integer solution to a nonlinear polynomial system with integer coefficients

asked 0 years ago

Periodic_1_6 gravatar image

updated 0 years ago

slelievre gravatar image

How do you check the uniqueness of an integer solution in a nonlinear system with integer coefficients in sagemath? And what is the computational cost?

import time
Start_Time = time.time()
var('N x y B c C d D E f F g G h H m L n')

eq0 = N - 43 == 0


eq1 = (2*(3*(3/2*x*(x+1))+1)-3*(-x)+1)/24+(3/4*(H)) - B == 0
eq2 = B+c*(c-1)/2 - (H) == 0
eq3 = (2*(3*(B)+1)-3*(c)+1)/24+(3/4*(H)) - C == 0
eq4 = C+d*(d-1)/2 - (H) == 0
eq5 = (2*(3*(C)+1)-3*(d)+1)/24+(3/4*(H)) - D == 0
eq6 = D+n*(n-1)/2 - (H) == 0
eq7 = (2*(3*(D)+1)-3*(n)+1)/24+(3/4*(H)) - H == 0




eq8 = (2*(3*((N-3)/8)+1)-3*(y)+1)/24+(3/4*(H)) - E == 0
eq9 = E+f*(f-1)/2 - (H) == 0
eq10 = (2*(3*(E)+1)-3*(f)+1)/24+(3/4*(H)) - F == 0
eq11 = F+g*(g-1)/2 - (H) == 0
eq12 = (2*(3*(F)+1)-3*(g)+1)/24+(3/4*(H)) - G == 0
eq13 = G+h*(h-1)/2 - (H) == 0
eq14 = (2*(3*(G)+1)-3*(h)+1)/24+(3/4*(H)) - L == 0
eq15 = L+m*(m-1)/2 - (H) == 0
eq16 = (2*(3*(L)+1)-3*(m)+1)/24+(3/4*(H)) - H == 0
eq17 = H - ((N-3)/8+y*(y-1)/2) == 0

eq18 = (N-3)/8+y*(y-1)/2 - 2*x*(x+1) == 0



solutions = solve([eq0,eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11,eq12,eq13,eq14,eq15,eq16,eq17,eq18],N,x,y,B,c,C,d,D,E,f,F,g,G,h,H,m,L,n)
sol = solutions  
Execution_Time = time.time() - Start_Time
print (Execution_Time)
print(sol)

solution

[
[N == 43, x == 5, y == 11, B == 57, c == 3, C == 59, d == -1, D == 60, E == 45, f == -5, F == 57, g == 3, G == 59, h == -1, H == 60, m == 1, L == 60, n == 1]
]
Preview: (hide)

Comments

1

To get a guaranteed answer, one'd better use computation via polynomial ideals. For example, see https://ask.sagemath.org/question/825...

Max Alekseyev gravatar imageMax Alekseyev ( 0 years ago )

@Max Alekseyev If I already have a solution, how can I say that it is unique?

Periodic_1_6 gravatar imagePeriodic_1_6 ( 0 years ago )

I think you cannot generally tell that there are no other solutions without computing all solutions and checking that there is only one. The computed variety of a polynomial ideal is guaranteed to contain all solutions.

Max Alekseyev gravatar imageMax Alekseyev ( 0 years ago )

@Max Alekseyev thank you

Periodic_1_6 gravatar imagePeriodic_1_6 ( 0 years ago )

@Max Alekseyev my question is the core of a primality test on the numbers 8*w+3. but it is not possible given a solution to know if it is unique so it does not matter

Periodic_1_6 gravatar imagePeriodic_1_6 ( 0 years ago )