Skip to main content

Posts

Showing posts from December, 2017

Solving Linear Diophantine Equations for all integer solutions Using Python

   What is a linear Diophantine Equation? The simplest linear Diophantine equation takes the form  ax  +  by  =  d , where  a ,  b  and  c  are given integers. The solutions are described by the following theorem: This Diophantine equation has a solution  (where  x  and  y  are integers)  if and only if   c   is a multiple of the  greatest common divisor  of   a   and   b .  Moreover, if  ( x ,  y )   is a solution, then the other solutions have the form   ( x  +  kv ,  y  −  ku ) ,  where   k   is an arbitrary integer, and   u   and   v   are the quotients of   a   and   b (respectively) by the greatest common divisor of   a   and   b . (source: wiki) To know whether a linear diophantine equation has integer solutions,   we...