Positive solution for linear Diophantine equations

  • Thread starter pyfgcr
  • Start date
  • #1
pyfgcr
22
0
The linear Diophantine equations: ax+by=c, a,b,c is natural numbers.
If c is a multiple of gcd(a,b), there is infinite integer solutions, and I know how to find x,y.
However, I wonder how to find positive integer solution x,y only.
 

Answers and Replies

  • #2
DonAntonio
606
1
The linear Diophantine equations: ax+by=c, a,b,c is natural numbers.
If c is a multiple of gcd(a,b), there is infinite integer solutions, and I know how to find x,y.
However, I wonder how to find positive integer solution x,y only.


They may not exists. For example, the equation [itex]\,7x+6y=5\,[/itex] cannot have positive solutions, but it has

solutions, like [itex]\,(5,-6)\,[/itex]

DonAntonio
 
  • #3
Mensanator
105
0
Shouldn't that be (5,-5)?
 
  • #4
DonAntonio
606
1
Shouldn't that be (5,-5)?


Yes, you're right of course. Thanks.

DonAntonio
 
  • #5
HallsofIvy
Science Advisor
Homework Helper
43,021
973
All solutions of the Diophantine equation ax+ by= c (assuming a, b, relatively prime) are of the form x= x0+ kb, y= y0- ka for k any integer. If you want both x and y positive, you must be able to choose k so that those are postive. Whether that is possible, of course, depends on a, b, x0, and y0.
 

Suggested for: Positive solution for linear Diophantine equations

Replies
4
Views
402
Replies
3
Views
580
  • Last Post
Replies
6
Views
854
Replies
5
Views
784
  • Last Post
Replies
3
Views
827
Replies
2
Views
641
  • Last Post
Replies
20
Views
666
  • Last Post
Replies
3
Views
509
Replies
5
Views
292
  • Last Post
Replies
4
Views
2K
Top