A diophantine equation is an equation of the type:where , and are three integers, and it is necessary that the solutions and are also integers.
The diophantine equations do not always have a solution. In fact, a diophantine equation only has a solution if the independent term (in our case, ) is divisible by the highest common factor of and .
In this case infinite solutions exist, which are given by:where and are the coefficients of the equality:found by means of the Euclides algorithm, and is any integer.
An interesting application of the diophantine equations is that they allow us to solve problems in everyday life. For example,
Example
Let's suppose that a gentleman is going to buy a book that costs €. Nevertheless, when he is going to pay he realizes that he only has coins of €. Moreover, the bookseller only has € notes. Can he pay the exact price of the book?
Well, this is solved by the following diophantine equation:
The represents how many coins of euros the gentleman has to give to the bookseller, and the how many € notes the bookseller has to retur to him as change, so that the gentleman is paying exactly €.
It is clear that the and the have to be integer, since the gentleman cannot give, for example, coins and a half, or the bookseller cannot return him notes.
Well, as we have already seen, the diophantine equation has its solution as , which divides . Besides a solution by means of the previous method, is and 1.
Namely the gentleman has to give to the bookseller coins of €, and he has to return him one € note: