Hi, I am new with Julia and I was wondering how can I solve a system of diophantine equations adding conditions to some of the variables. For example, I would like to find integers x, y, p, h, r, t that solve the equations

eqn1: (t+8)(15)=(p-8)(r-15)

eqn2: 58(x-15)=(y+8)(r-15)

eqn3: (x+40)(h-80)=40(y-80)

Subject to the constraints

48<t<51

0<y<50

r>0 and p>0.

In Matlab I would use solve([eqn1,eq2,eq3,conditions],[variables]) using ‘integer’ at the begining.

1 Like

For individual solutions, this could be approached with JuMP and GLPK in combination.

Linear integer programming problems are discussed in the documentation of JuMP.

2 Likes

Have a look at this function and see if it solves your problem

https://juliahub.com/ui/Documentation?q=diophantine