Buckets of Water
There are 3 buckets labelled (small) of litres, (medium) of litres and (large) of litres.
Initially and are full of water and is empty. By pouring water between the buckets exactly one litre of water can be measured.
Since there is no other way to measure, once a pouring starts it cannot stop until either the source bucket is empty or the destination bucket is full.
At least four pourings are needed to get one litre:
After these operations, there is exactly one litre in bucket .
In general the sizes of the buckets are , , litres, respectively. Initially and are full and is empty. If the above rule of pouring still applies and and are two coprime positive integers with then it is always possible to measure one litre in finitely many steps.
Let be the minimal number of pourings needed to get one litre. Thus .
Also, and .
Find the sum of for all pairs of prime numbers such that .
Give your answer modulo .
水桶倒水
现有三个水桶,标记的小水桶可以装升水,标记的中水桶可以装升水,标记的大水桶可以装升水。
一开始,小水桶和中水桶均装满了水,而大水桶则是空的。通过在水桶间互相倒水,我们希望量出恰好一升水。由于我们缺乏其他的测量手段,在倒水时只能要么将倒出的水桶倒空要么将倒入的水桶装满。
为了量出恰好一升水,至少需要倒四次:
经过这些操作后,在小水桶中恰好有一升水。
考虑一般情况,即小、中、大水桶的容积分别为、和升。一开始小水桶和中水桶均装满了水而大水桶是空的。采用相同的倒水规则,若和是两个互质的正整数且满足,那么在有限步内总是能够量出恰好一升水。
记为量出一升水所需的最少倒水次数,因此。
此外,,。
对于所有满足的素数对,求之和,并将你的答案对取余。
Be the first person to leave a comment!