[SOLVED] Finding the sum of two unknown variables

The question is to find the sum of the unknown variables. Now, the variables have to be integers, and as you can see from the easy example I made, the sum could be

Of course, this is not the only solution. Try the following:

I suspect that there are even more integer solutions to this equation. My method for finding the values is the old simple bruteforce "technique", where I divide 4323 by highest coefficient and that's where I get a headstart. You can of course find out the pattern, but these "cooked" equations are no good for learning.

My question is: is there a logical process of solving for ? Other than bruteforce, of course. I asked my teacher today, and he just said "that's number theory." I looked up number theory, but I was kind of lost.

These type of questions are pretty common on the SAT I tests, and I love them. My brother and I used to exchange multivariable equations like that and try to find the sum all the time.

What comes in my mind is that we have to solve for p and q before finding p+q... maybe there is another method...
This comes with the Euclidian algorithm, which will yield to Bézout's theorem (google for them).

43 & 23 are coprime, that is to say they have no common divider.
The theorem states that if 43 and 23 are coprime, then we can write it :, where u & v are integers (positive or negative).

-------------------------
Now, the thing is that you have to find a particular solution to the equation , thanks to the Euclidian algorithm.

Thus

--------------------------
What's good with it is that we can multiply the equation by 4323 in order to get a particular solution for p and q in

-->

---------------------------MOO

So we have :

Because 43 and 23 are coprime, we know by the Gauss theorem, that and ,

Therefore the general solution is :

Remember, and

------------------------------

and are ugly because 4323 is a large number, and I showed a general method.

If you have got a particular solution (100 and 1), set up and and take it from the red MOO.

Ok...Gauss theorem = Euclid's lemma (they're the same, but I don't know the circumstances that made 2 different names lol)

If a positive integer divides the product of two other positive integers, and the first and second integers are coprime, then the first integer divides the third integer.
This can be written in notation:
If n|ab and gcd(n,a) = 1 then n|b.