Browse · MathNet
Print51st Ukrainian National Mathematical Olympiad, 3rd Round
Ukraine counting and probability
Problem
There are candies on the table. At each step Petro can take away some of them. At the first step he takes away one candy and on each next step he can take away either the same amount or twice the amount that he has taken at the previous step. What is the minimal number of steps does Petro need in order to take from the table away exactly candies?
Solution
Answer: .
Note, that on each step the number of candies that Petro takes from the table is a power of . Moreover, if at some step Petro takes away candies, then there were the moves where he was taking away . Thus, the maximum number that Petro could take can not exceed , since .
We assume that Petro keeps optimal strategy. Note, that the number of steps when Petro takes away exactly candies can not exceed , otherwise, he could reduce the number of moves by taking candies instead. This implies that he could not take less than candies each time because .
Therefore Petro was taking candies. We write this in the following form: , where is the number of times he was taking candies. This is equivalent to: , where .
Since binary representation is unique we have , since Hence, have values and optimal number of steps is .
Note, that on each step the number of candies that Petro takes from the table is a power of . Moreover, if at some step Petro takes away candies, then there were the moves where he was taking away . Thus, the maximum number that Petro could take can not exceed , since .
We assume that Petro keeps optimal strategy. Note, that the number of steps when Petro takes away exactly candies can not exceed , otherwise, he could reduce the number of moves by taking candies instead. This implies that he could not take less than candies each time because .
Therefore Petro was taking candies. We write this in the following form: , where is the number of times he was taking candies. This is equivalent to: , where .
Since binary representation is unique we have , since Hence, have values and optimal number of steps is .
Final answer
17
Techniques
Induction / smoothingOther