find all positive integers for a given diophantine equation involving 4 or 7 variables

222 Views Asked by At

Given equation:

Ap + Bq + Cr + Ds + Et + Gu + Vg = K; (Eq. in 7 variables);

suppose we have A, B, C, D initialize with = 1,2,5,10,20,50 and 100 respectively; and K = 50000;

How do we solve it?

and also consider equation in 4 variables.

Aw + Bx + Cy + Dz = K where A,B,C,D are 5,10,50 and 100 respectively; and K = 5...n how do we solve it?

and How to know whether is has solution in positive integers?

1

There are 1 best solutions below

0
On

The second question is simple: There exists a nonnegative solution $(x,y,z,w)$ iff $K$ is a nonnegative multiple of $5$. This is so because $B,C,D$ are multiples of $A$.

If one wants to count the number of solutions, I suggest to use dynamic programming. For the asymptotic number of solutions for growing values of $K$, I'd recommend the use of generating functions, but I suppose you'd prefer the concrete calculations for varying input.