Griphook tries to find the magic code
Source: Azerbaijan NMO 2023. Senior P4
August 24, 2023
combinatoricsAZE SENIOR NATIONAL MO
Problem Statement
To open the magic chest, one needs to say a magic code of length consisting of digits Each time Griphook tells the chest a code it thinks up, the chest's talkative guardian responds by saying the number of digits in that code that match the magic code. (For example, if the magic code is and Griphook says the chest's talkative guard will say ). Prove that there exists a number such that for any natural number Griphook can find the magic code by checking at most times, regardless of what the magic code of the box is.