Skip to main content
OlympiadHQ

Browse · MathNet

Print

Bulgarian National Mathematical Olympiad

Bulgaria number theory

Problem

The positive integers and are such that , and . A cash machine is loaded with leva. For any it is allowed to withdraw leva (if the machine has at least leva), and after that the bank puts in the machine leva. It is also allowed to withdraw without any action from the bank. Find all positive integers for which the cash machine can be emptied by the above described operations.
Solution
Set , , where . Without loss of generality assume that there exists , such that for and for .

If is one of the desired values then there exist positive integers for which



Therefore is a divisor of .

We prove now that if is a divisor of then one can empty the cash machine.

Indeed, in this case it follows from Bezout's theorem that has solution in integers. Set , , , , , . Since , it is clear that for big enough , is a solution of in positive integers and . Consider one such solution and let , , and , . For big enough we obtain a solution of , for which





We draw money in the following way. Take first times leva then times leva, ..., times leva. After that we take times leva, ..., times leva. Since and all operations are feasible. Now implies that there are exactly leva left in the machine and we withdraw them by taking times leva.

Answer. All divisible by .
Final answer
All n ≥ a9 such that n is divisible by d = gcd(a0, |a1 − b1|, |a2 − b2|, …, |a9 − b9|).

Techniques

Greatest common divisors (gcd)Invariants / monovariants