Sir-Emo-Chappington solved this with two variables.....here's a way to do it with one......
Let x be one integer ...and let 18x + 29 be the second integer....so we have....
x (18x + 29) = 6354 simplify
18x^2 + 29x = 6354 rearrange
18x^2 + 29x - 6354 = 0 this factors as
(18x + 353) (x - 18) = 0 the only integer produced here is when x = 18
And the second integer is 18(18)+ 29 = 353
I think this method is a little easier because we don't have to use two equations and a substitution to solve......but......SEC's method is perfectly valid, too !!!!
There are probably easier ways to do this.....but....here's my reasoning.......
The "filling" scoop has to operate an odd number of times, because 46,899 * an odd will produce an odd. And the "removing" scoop always removes an even number of candies. So, the difference between an odd and an even is always an odd......
Let's say the flling scoop operates once and the removing scoop operates 3 times......then the number of candies left in the vat is just 46899 mod (3*13576) = 6171
Now...let's say that the filling scoop operates 3 times = 140697 candies added to the vat ....and that the removing scoop operates 10 times = 135760 candies removed from the vat
Then 140697 mod 135760 = 4937 .... and 6171 - 4937 = 1234
Lastly....let the filling scoop operate 5 times = 234495 candies added to the vat, and let the "removing" scoop operate 17 times = 230792 candies removed from the vat
Then 234495 mod 230792 = 3703 = 6171 x 2(1234)
Notice the patern.....for every 2n - 1 times the "filling" scoop operates and for every 3 + 7(n-1) times the "removing" scoop operates, the mod remainder after the first time (where n = 1) = (6171) ... and this is reduced by 1234 for each successive integer value of "n"
So..... 6171/1234 = 5
This means that, when the "filling" scoop operates n = 5 more times after the first operation, i.e., 2(6) - 1 = 11 total times, the number of candies put into the vat is 11*46899 = 515889. And the removing scoop will have operated 3 + 7(6-1) = 38 times in which 38 * 13576 = 515888 candies have been removed from the vat.....so..... 515889 added - 515888 removed = 1 remaining candy in the vat.....
[I'm pretty sure that there is some sort of algorithm for solving this......but....I'm not familiar with what it might be....!!! ]
P.S. - I believe this can also be solved by using something known as a"Diophantine" Equation.....I'm not familiar with this technique, but I'm reading about it here.....http://www.wikihow.com/Solve-a-Linear-Diophantine-Equation