Linear Diophantine Equation

Revision en1, by SPyofgame, 2020-11-24 16:48:03

It is well known problem. Where we have the equation

Unable to parse markup [type=CF_MATHJAX]

$

But, if I need to calculat the number of non-negative integer solution of $$$(x, y)$$$, can I have a simplier implementation then this ? (My algorithm based on cp-algorithm)

Recursive extended greatest common divisor
Find one solution ax + by = c
Shift solution
Count number solutions of ax + by = c with given range x & range y
Count all nonegative solutions (x, y) satisfy ax + by = c
Tags linear diophantine, c++, math, extended gcd

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English SPyofgame 2020-11-24 17:16:55 55
en4 English SPyofgame 2020-11-24 17:06:42 361
en3 English SPyofgame 2020-11-24 17:02:25 558 Tiny change: 'rset{n}{\Sigma}} a_i \cd' -> 'rset{n}{\SIGMA}} a_i \cd'
en2 English SPyofgame 2020-11-24 16:52:29 393
en1 English SPyofgame 2020-11-24 16:48:03 4234 Initial revision (published)