MathDB
Find all possible values of n - [Bulgaria NMO 2010]

Source:

December 29, 2010
modular arithmeticcombinatorics unsolvedcombinatorics

Problem Statement

Let a0,a1,,a9a_0, a_1, \ldots, a_9 and b1,b2,,b9b_1 , b_2, \ldots,b_9 be positive integers such that a9<b9a_9<b_9 and akbk,1k8.a_k \neq b_k, 1 \leq k \leq 8. In a cash dispenser/automated teller machine/ATM there are na9n\geq a_9 levs (Bulgarian national currency) and for each 1i91 \leq i \leq 9 we can take aia_i levs from the ATM (if in the bank there are at least aia_i levs). Immediately after that action the bank puts bib_i levs in the ATM or we take a0a_0 levs. If we take a0a_0 levs from the ATM the bank doesn’t put any money in the ATM. Find all possible positive integer values of nn such that after finite number of takings money from the ATM there will be no money in it.