Hi,

I want to know the number of solutions of the diophantine equation

ax+by=n

where a,x,b,y,n are positive and a,b,n are given.

The first thing I do is checking whether n is a multiple of gcd(a,b). If this is not the case, there are 0 solutions. Otherwise we divide the equation by gcd(a,b) and thus can assume a and b are coprime.

But what can I do now? The euclidean algorithm does not work since x and y have to be positive.

Cheers,

Plaso