How to find solutions to a linear Diophantine equation restricted to given intervals of x and y?

102 Views Asked by At

For example: find all $x$, $y$ satisfying $10x + 20y = 300$ and $-10 < x < 10 , 0 < y < 20$. I wanted to write a program for this.

1

There are 1 best solutions below

0
On BEST ANSWER

After dividing by $$10$$ we get $$x=30-2y$$ so we obtain $$-10<30-2y<10$$ and from here $$10<y<20$$ These are the solutions $$(x=-8\land y=19)\lor (x=-6\land y=18)\lor (x=-4\land y=17)\lor (x=-2\land y=16)\lor (x=0\land y=15)\lor (x=2\land y=14)\lor (x=4\land y=13)\lor (x=6\land y=12)\lor (x=8\land y=11)$$